0832/0809 Example 10-1 (1) (2) (3) 10-6, the program above 10-6 (square wave, rectangular wave)
Chapter 8, Expansion Diagram, "Lecture 14 will do as long as you can."
Serial port:
PO mouth:
When the external expansion memory is used as a data bus, DB
When it is not expanded, it can be used as a general I/O, but there is no internal pull-up resistor. When used as input or output, it should be connected to an external pull-up resistor .
P1 port:
Only used as I/O port: there is a pull-up resistor inside.
The P2 port has two functions:
When expanding external memory, it is used as an address bus, AB
Used as a general I/O port, it has a pull-up resistor inside;
The P3 port has two functions:
In addition to being used as IO,
There are also some special functions, which are set by special registers (RXD, TXD, external interrupt input INT1/0, WR, RD)
EA is invalid: first visit the on-chip and then off-chip. At this time, no external expansion exceeding 64KB can be added
EA valid: direct access to external ROM
EA must enable the interrupt when it is interrupted
PSEN
When reading external program memory (when EA is active), _PSEN_ is active low to enable the external ROM to run.
EX0/EX1: external interrupt enable signal
IT0, IT1: Interrupt mode: 1 is falling edge trigger, 0 is low level trigger, default low level trigger
Tips:
The serial port can be used as an I/O port: P0 is an external pull-up resistor; P1, 2, and 3 have internal pull-up resistors.
Involving external RAM and ROM pins
Time-sharing multiplexing:
English explanation:
cy = cycle
osc = oscillating (cycle) oscillation (cycle)
External: X in XTAL means external
sbit puts bit addressable things
ALE==Address Lock Enable
Crystal oscillator
51 minimum system:
Power supply, ground, reset circuit, crystal oscillator circuit.
Crystal:
It provides the pulse of 51 single-chip microcomputer, a complex sequential circuit, which is the heart of 51 single-chip microcomputer! The two pins XAL1 and XAL2 are clock access pins, which are the arteries of 51. When the oscillation generated by the crystal oscillator is input to the single-chip microcomputer, there will be a pulse signal, and the internal sequential circuit of 51 can also work. These pulses are called clock signals, the period of the clock signal is called clock period, and the frequency is called clock frequency.