AT89C51 Microcontroller Structure, Features, Function, AT89C51 vs AT89C52 and Applications

08 December 2023


Ⅰ. What is AT89C51?

Ⅱ. Pin configuration of AT89C51 microcontroller

Ⅲ. Structure of AT89C51 microcontroller

Ⅳ. What are the features of AT89C51 microcontroller?

Ⅴ. Function of AT89C51 microcontroller

Ⅵ. Block diagram of AT89C51 microcontroller

Ⅶ. What are the difference between AT89C51 and AT89C52?

Ⅷ. What are the applications of AT89C51 microcontroller?



Nowadays, microcontrollers have penetrated into all areas of our daily life, from small household appliances and instruments to large medical devices and aerospace. Today, we will introduce the AT89C51 microcontroller, enhancing your comprehension of its functionalities and offering robust assistance for the design of embedded systems.



Ⅰ. What is AT89C51?

2435e08292b105b24c11d753efc4aa34.png

AT89C51 is an 8-bit microcontroller manufactured by Atmel with 16KB FLASH program memory and 512B RAM data memory. It is produced using high-density, non-volatile access technology and is compatible with the standard MCS-51 instruction system. It is powerful with a general-purpose 8-bit central processing unit (CPU) and Flash memory unit. In addition, the AT89C51 microcontroller has a built-in voltage regulator that ensures a stable 5V power supply for the CPU and other components, allowing it to operate reliably over a fairly wide range of input voltages.


The microcontroller supports a variety of programming methods, including ISP (In-System-Programming), IAP (In-Application-Programming), DebugWire, etc., which are suitable for a wide range of applications such as home appliances, logistics tracking, computer peripherals and automotive electronics.


Replacements and equivalents:

• MSP430

AT89S52

• ATMEGA328

PIC16F877A



Ⅱ. Pin configuration of AT89C51 microcontroller


f79c9b431a86104cb20727246aab58f8.png


AT89C51 has 40 pins and has good pin compatibility with other 51 series microcontrollers. These pins can be subdivided into four parts, namely control lines, power lines, I/O port lines and external crystal lines.


• Control lines: These pins are used to implement various control functions such as reset, clock, and interrupt.


• Power line: This part of the pin is responsible for providing the required power to the chip, usually including VCC and GND pins.


• I/O port lines: This section contains a number of pins that can be independently configured and controlled for input and output operations.


• External crystal line: This part of the pin is used to connect an oscillator or external crystal to provide a clock signal.



Ⅲ. Structure of AT89C51 microcontroller


1. Interrupt system


The AT89C51 has a programmable interrupt controller capable of handling interrupt sources from both external and internal sources. It can respond to various interrupt requests and execute corresponding interrupt service routines.


2. Timer/counter


AT89C51 has two timers/counters, namely Timer 0 and Timer 1. They enable functions such as precise time delay, timing and pulse width modulation. These counters are easily configured and controlled via software.


3. CPU core


AT89C51 uses an 8-bit 8051 CPU core, including a tightly coupled ALU (arithmetic logic unit), register set and instruction set. It supports most 8-bit data processing and control operations.


4. Clock and reset circuit


AT89C51 requires an external crystal oscillator or clock source to provide the clock signal. It also contains a reset circuit to initialize the state of the microcontroller.


5. I/O interface


AT89C51 has four 8-bit parallel I/O ports (including P0, P1, P2, P3), which can be used to connect external devices and sensors. Each I/O port can be configured as input or output, and its status can be controlled through software.


6. Serial communication


AT89C51 has a programmable serial communication interface (UART) for serial data transmission with external devices. It supports multiple communication protocols and data formats.


7. Memory


The AT89C51 has 4K bytes of flash memory for storing program code. Additionally, it has 128 bytes of RAM for storing temporary variables and data.



Ⅳ. What are the features of AT89C51 microcontroller?


• AT89C51 adopts MCS-51 architecture, which is easy to understand and program.


• It supports multiple programming methods such as ISP, IAP and DebugWire.


• It supports general I/O and special function I/O, such as dual interrupts, triple timers, etc.


• It has 16KB program memory and 512B data memory.


• It supports 12MHz internal crystal oscillator and external oscillator, and the external clock frequency is 0 to 24MHz.



Ⅴ. Function of AT89C51 microcontroller


1. Interrupt processing


AT89C51 supports timer interrupts, external interrupts and serial port interrupts, etc. These interrupts can quickly respond to external events and execute the corresponding interrupt service routine.


2. Programming upgrade


AT89C51 uses flash memory, so the running program can be changed through programming, thus facilitating system upgrades and expansion.


3. Timing control


The AT89C51 features two 16-bit timer/counters that can be used for applications such as timer interrupt generation, frequency measurement, and pulse width modulation.


4. Data processing


AT89C51 has built-in powerful data processing capabilities and can process, store and transmit various data. Depending on the needs, we can use the built-in flash memory, arithmetic logic unit (ALU) and RAM memory to implement various data operations.


5. Peripheral control


AT89C51 also has a variety of peripheral functions, including serial port, SPI interface, general-purpose input/output pins (GPIO) and two 16-bit timer/counters, etc., which can be used to communicate and control with other hardware devices.



Ⅵ. Block diagram of AT89C51 microcontroller


8f68980062e7d473386425b0af049f80.png



Ⅶ. What are the difference between AT89C51 and AT89C52?


1. Number of timers


T89C52 has three timers, namely T0, T1 and T2, which are all 16-bit timers. In addition to T0 and T1 of AT89C51, AT89C52 also adds a new T2 timer.


2. Number of interrupt sources


AT89C51 has 6 interrupt sources. In addition to the timers T0 and T1 of the AT89C51, the AT89C52 also has an additional timer T2.


3. Internal FLASH capacity


AT89C51 and AT89C52 are two models of microcontrollers. Among them, AT89C52 is an upgraded version of AT89C51 in all aspects. AT89C51 has an internal FLASH PERAM of 4K bytes, while the capacity of the internal FLASH PERAM of AT89C52 has doubled compared to AT89C51, reaching 8K bytes.


4. Random access data memory (RAM)


The AT89C51 has 128 bytes of internal RAM, while the AT89C52's internal RAM is extended to 256 bytes.



Ⅷ. What are the applications of AT89C51 microcontroller?


• Communication devices: AT89C51 can be used for Modem, communication interface, data transmission equipment and other various communication devices.


• Intelligent instrumentation: AT89C51 can be used for temperature instrumentation, power instrumentation, pressure instrumentation and so on. By combining with sensors, it can realize the functions of data acquisition, processing and display.


• Automotive electronics: By combining with sensors and actuators, AT89C51 can realize intelligent control and management of automotive electronics.


• Smart home: In the smart home system, AT89C51 can be used to control lighting, temperature and various security systems. By connecting with various sensors and actuators, it can realize intelligent control of home environment.


• Embedded system: It is often used to design embedded systems. It can handle a variety of input and output devices to realize the monitoring and control of the system.


• Medical devices: AT89C51 can be used in therapeutic devices and medical imaging devices. By combining with medical sensors, it can realize the functions of data acquisition, processing and display.




Frequently Asked Questions


1. What is AT89C51?


AT89C51 is an 8-bit microcontroller and belongs to Atmel's 8051 family. ATMEL 89C51 has 4KB of Flash programmable and erasable read only memory (PEROM) and 128 bytes of RAM. It can be erased and program to a maximum of 1000 times. In 40 pin AT89C51, there are four ports designated as P1, P2, P3 and P0.


2. Is 8051 and AT89C51 same?


89C51 is an enhanced version of the 8051 microcontroller, which has 4 KB of flash memory, 128 bytes of RAM, and 32 I/O lines. It has a 6-clock ins.


3. What does the term C indicates in AT89C51?


This is a series of microcontroller based on 80551 architecture. Here AT stands for ATMEL. C stands for CMOS. 89 is a series of variants which ATMEL was developing .


4. What is difference between at89s51 and AT89C51?


What is the difference between the 89C51 and 89S51 microcontrollers? The “S” version is programmed “in system” (ISP = in system programming), while the C version needs a parallel programmer.


5. Why we use AT89C51?


Concepts of wireless RF communication and automation with AT89C51 microcontroller are used here. The system is small, simple, cost-effective and good for wireless control of home appliances or industrial instrumentation. The system comprises a transmitter and a receiver as described below.