Vcc:+5v power supply input.
Vss: Power ground terminal. Clock pin
XTAL 1: on-chip amplifier input. XTAL2: On-chip amplifier
Output terminal. Dedicated control port
(1)ALE/PROG, dual-function control port.
①ALE, the address latch allows the signal output to end.
During accessing the off-chip program memory, the ALE signal appears twice every machine cycle, and its falling is used to latch the low 8-bit address output from the P0 port.
When accessing the off-chip program memory, the signal also appears stably at the oscillation frequency of 1/6, so it can be output as a clock pulse. However, when accessing the off-chip data memory, the ALE pulse will be skipped, which is not suitable for clock output.
②PROG, for chips with EPROM on chip, this pin is used as the input of programming pulse PROG during programming.
(2)PSEN, the off-chip program memory reads the output end of the strobe signal, and the frequency of the PSEN signal is 1/6 of the oscillation frequency. During reading off-chip program memory, this signal is set to low level twice in each machine cycle. If there is an operation to access the off-chip data memory during reading the off-chip program memory, the PSEN signal will have a gap phenomenon.
(3)RST/Vpd: The control port ①RST with dual control functions is used as the reset signal input. When the RST input remains high for two machine cycles, the microcontroller can complete the reset operation. ② ② Input end of ②②Vpd standby power supply.
(4)EA/VDD: The dual-function control terminal ①EA accesses the off-chip program memory permission terminal, and when the low level is connected, the CPU only accesses the off-chip ROM;; When high level is connected, the CPU accesses the on-chip ROM first, and if the access address is greater than a certain range, it will automatically switch to the off-chip ROM.
②VDD programming power input terminal, which is used to input programming power when writing programs to on-chip ROM. Input/output port
5 1 MCU * * has 32 I/O pins, which are divided into four groups: P0, P 1, P2 and P3***. Each group of ports has 8 pins for transmitting data, addresses or control signals.
①P0 port (P0.7~P0.0): It can be used as both an address/data bus and a general I/O port. Open drain, bidirectional I/O port. P0 port can be used as a general-purpose I/O port, but a pull resistor must be connected externally. As an output port, each pin can absorb 8 TTL of current. As input, first set the pin to 1. The P0 port can also be used as the multiplexing line of the low-order eight-bit address/data bus of the external program memory and the data memory. In this mode, the P0 port contains an internal pull-up resistor. When programming in Flash, P0 port accepts code data; During program verification, P0 port outputs code byte data (external pull-up resistor is required).
②P 1 port (P 1.7 ~ P 1.0): 8-bit, bidirectional I/O port with built-in row-pull resistor. P 1 can be used as an ordinary I/O port. The output buffer can drive four TTL loads; When used as an input, the cross pin is set to 1 and raised to a high level by the on-chip pull-up resistor. The pin of P 1 port can be pulled down by external load, and the pull-up resistor provides pull-up current. In the parallel programming and verification of Flash, P 1 port can input low byte address. During serial programming and verification, P 1.0/MOSI, P 1.6/OSI and P 1.7/SCK are serial data input, output and shift pulse pins respectively. 8-bit bidirectional I/O with internal pull resistance.
③P2 port (P2.7~P2.0): As an output port, it can drive four TTL loads; When used as an input port, first set the pin to 1 and raise it to a high level through an internal pull-up resistor. If the load is at a low level, the current is output through the internal pull-up resistor. When the CPU accesses the external memory with the address of 16, the P2 port provides the upper 8-bit address. When CPU addresses external memory with 8-bit address, P2 port is the content of P2 special function register. When programming and checking FLASH in parallel, P2 port can input high byte address and some control signals.
④P3 port (P3.7~P3.0): The local office has an 8-bit bidirectional port with built-in pull-up resistor. When the P3 port is on the left and right, the output buffer can absorb the current of 4 TTLs. When used as an input port, the pin is first set to 1, and the internal pull-up resistor is pulled high. If the external load is at a low level, the current is output through the internal pull-up resistor. When programming and checking in parallel with FLASH, P3 port can input some control signals.