This article uses two MCUs, AT89S51 and AT89C2051, from the 51 series family produced by ATMEL, as examples. These two MCUs are currently the most commonly used MCUs. The AT89S51 is a standard 51 MCU, but of course it is more powerful than the earlier 51 MCUs, supports ISP in-system programming technology, and has a built-in hardware watchdog. . .
1. Introduction to AT89S51 microcontroller pins
AT89S51 has three packaging methods: PDIP, PLCC, and TQFP. The most common one is the dual-row direct PDIP package with 40 pins. The appearance structure is shown in the figure below.
The chip has 40 pins in total. The pins are arranged in the order of 1, 2, 3, 4, and 40 from the left column of pins near the chip notch (see the right picture). Among the 40 pins of the microcontroller, there are 2 power pins, 2 external crystal oscillator pins, 4 control pins, and 32 4 groups of 8-bit programmable I/O pins.
1. Main power pins (2 pins)
VCC (Pin40): power input, connected to +5V power
GND (Pin20): ground wire
2. External crystal oscillator pins (2 pins)
XTAL1 (Pin19): Input of the internal oscillator circuit
XTAL2 (Pin20): Output of the internal oscillator circuit
3. Control pins (4 pins)
RST/VPP (Pin9): Reset pin. A high level of 2 machine cycles on the pin will reset the microcontroller.
ALE/PROG (Pin30): Address latch enable signal
PSEN (Pin29): External memory read select signal
EA/VPP (Pin31): Internal and external select of program memory. If it is connected to a low level, instructions are read from the external program memory. If it is connected to a high level, instructions are read from the internal program memory.
Actual chip picture Chip pin function
4. Programmable input/output pins (32 pins)
The AT89S51 microcontroller has 4 groups of 8-bit programmable I/O ports, namely P0, P1, P2, and P3. Each port has 8 bits (8 pins), for a total of 32 pins. Each pin can be programmed, such as to control motors, traffic lights, neon lights, etc. When developing products, we use these programmable pins to achieve the functions we want. Give full play to your imagination and achieve what you want:) It is extremely powerful. . .
PO port (Pin39~Pin32): 8-bit bidirectional I/O port line, named P0.0~P0.7
P1 port (Pin1~Pin8): 8-bit quasi-bidirectional I/O port line, named P1.0~P1.7
P2 port (Pin21~Pin28): 8-bit quasi-bidirectional I/O port line, named P2.0~P2.7
P3 port (Pin10~Pin17): 8-bit quasi-bidirectional I/O port line, named P3.0~P3.7
The above is a brief introduction to the pins of the AT89S51 microcontroller. The pins of other 51 series microcontrollers such as 8031, 8051, 89C51, etc. are compatible with the 89S51, except that the function definitions of individual pins are different.
2. Introduction to AT89C2051 MCU Pins
The AT89C2051 is a 20-pin small package with 2K internal program memory, 15 programmable I/O lines, 16 I/O lines without P0 and P2, and an analog comparator is integrated inside. The pinout of the AT89C2051 microcontroller is shown in the figure below.
Actual chip picture Chip pin function
The chip has 20 pins in total. The pins are arranged in the order of 1, 2, 3, and so on, counting counterclockwise from the left column of pins near the notch of the chip (see the figure above). Among the 20 pins of the microcontroller, there are 2 power pins, 2 external crystal oscillator pins, 1 reset pin, and 15 programmable I/O pins of ports P1 and P3.
1. Main power pins (2 pins)
VCC (Pin 20): power input, connected to +5V power
GND (Pin 10): ground wire
2. External crystal oscillator pins (2 pins)
XTAL1 (Pin5): Input of the internal oscillator circuit
XTAL2 (Pin4): Output of the internal oscillator circuit
3. Control pin (1 pin)
RST/VPP (Pin1): Reset pin. A high level of 2 machine cycles on the pin will reset the microcontroller.
4. Programmable input/output pins (15 pins)
P1 port: 8-bit quasi-bidirectional I/O port lines, P1.0~P1.7, 8 pins in total
P3 port: 8-bit quasi-bidirectional I/O port lines, P3.0~P3.5, P3.7, 7 pins in total
Smart people will definitely find that: the standard 51 microcontroller has 32 programmable I/O lines. After 89C2051 streamlines the 16 I/O lines of P0 and P2, there should be 16 I/O lines. Now there are only 15. Where did the other one go? ! As mentioned earlier, AT89C2051 integrates an analog comparator. It is precisely because of the integration of the analog comparator that another lead is occupied. The output end of the comparator occupies an I/O port, which is P3.6. Pin P3.6 is not connected, so there is one less I/O line. When programming, P3.6 can only be used to read the state of the comparator, and cannot be used to drive external indicator lights and other devices like other I/O ports. However, the analog comparator is very practical, and the trouble of adding an external comparator can be saved in development. The figure shows the principle of the comparator.
3. Introduction of main performance parameters
AT89S51
·Fully compatible with the MCS-51 product instruction system
·4k bytes of in-system programming (ISP) Flash memory
·1000 erase and write cycles
·4.0-5.5V operating voltage range
·Fully static operating mode: 0Hz-33MHz
·Three-level program encryption lock
·128×8 bytes of internal RAM
·32 programmable I/O lines
·2 16-bit timers/counters
·6 interrupt sources
·Full-duplex serial UART channel
·Low-power idle and power-down modes
·Interrupts can wake up the system from idle mode
·Watchdog (WDT) and dual data pointers
·Power-down flag and fast programming features
·Flexible in-system programming (ISP byte or page write mode)
AT89C2051
·Fully compatible with the MCS-51 product instruction system
·2k bytes of re-erasable Flash memory
·1000 erase and write cycles
·2.7V-6V operating voltage range
Fully static operation: 0Hz-24MHz
Two-level encrypted program memory
128×8 bytes of internal RAM
15 programmable I/O lines
2 16-bit timers/counters
6 interrupt sources
Programmable serial UART channels
Output port that can directly drive LEDs
One built-in analog comparator
Low-power idle and power-down modes
Previous article:Digital tube dynamic display of numbers
Next article:Infrared remote control software decoding principle and program (C language)
Recommended ReadingLatest update time:2024-11-15 13:33
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Three steps to govern hybrid multicloud environments
- Three steps to govern hybrid multicloud environments
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- [TI Recommended Course] #[High Precision Lab] Operational Amplifier: 2 Input Offset Voltage and Input Bias Current#
- STM32F4 hardware I2C driver 0.96 OLED screen
- Analog electronics course selection test + isolation course learning
- Why can't my INT function enter the interrupt?
- [RT-Thread Reading Notes] Part 2 (3) Semaphores and Mutexes
- What software do I use for schematic illustrations?
- Problems encountered in debugging B-U585I-IOT02A WIFI module
- 2021 National Undergraduate Electronic Design Competition Restart Notice and Schedule
- MicroPython 1.18 released
- Last day: Let's play together, AI development board based on Allwinner R329 chip