8051 Tutorial 1: Introduction to AT89C2051

What is 8051?

The 8051 is a popular 8-bit single chip microcontroller which was first introduced by Intel. The first 8051 is a 40-pin microcontroller which has 4kB of program memory, 128 bytes of RAM, 2 timer/counter, 1 UART, and six interrupt sources.

Later on, the 8052 microcontroller was introduced. The 8052 microcontroller is a better version of 8051 microcontroller. It has 8kB of code memory and 256 bytes of RAM. It also has an additional timer.

8051 became very propular and it became an industry standard. Due to its popularity, many semiconductor manufacturers like Atmel, Infineon Technologies, Maxim Integrated Products, NXP, ST Microelectronics, Silicon Laboratories, Texas Instruments, Cypress Semiconductor, etc have included 8051 in their line of products.

What is AT89C2051?

AT89C2051 is manufactured by Atmel and it is a member of 8051 family of microcontrollers. Unlike the original 8051 microcontroller which has 40 pins, AT89C2051 has only 20 pins which makes it ideal for 8051 beginners. It takes the standard features of the original features of 8051 except that it has only 20 pins compared to 40 pins of the original 8051. However, AT89C2051 is made of flash program memory and it has additional on-chip analog comparator.

8051 8052 AT89C2051
4kB code memory 8kB code memory 2 kB code memory
128 bytes RAM 256 bytes RAM 128 bytes RAM
Two 16-bit Timer Counters Three 16-bit Timer/Counters Two 16-bit Timer Counters
One Programmable Serial UART One Programmable Serial UART One Programmable Serial UART
40 pins (32 IO pins) 40 pins (32 IO pins) 20 pins (15 IO pins)
Six Interrupt Sources Eight Interrupt Sources Six Interrupt Sources
    On-chip Analog Comparator

  

AT89C2051 Pin Diagram and Description

VCC

This pin is the supply voltage pin. The voltage range that can be supplied to this pin is from 2.7 volts to 6 volts but the most commonly used is 5 volts. Just remember to put a decoupling capacitor across this pin to filter out sudden voltage changes in the supply line and put the capacitor as close to VCC pin as possible. Typical values for the capacitor is 100nF.

GND

This is the pin for ground.

XTAL1 & XTAL2

These are the input and output, respectively, of the inverting oscillator amplier located inside AT89C2051. The inverting oscillator amplier can be used as an on-chip oscillator as shown below. Either a quartz crystal or a ceramic resonator may be used. The values of C1 and C2 can be from 20pF to 40pF if a quartz crystal is used and 30pF to 50pF if a ceramic oscillator is used. Frequencies can be up to 24MHz.

The device can also be driven by an external clock source. Just connect the external clock source to XTAL1 and leave XTAL2 unconnected.

 

RST

This is the input for device reset. The device is being reset as soon as the RST pin goes HIGH.

There is one thing that must be considered for this pin. The  AT89C2051 must operate as intended as soon as it is powered up. To be able to make that happen, AT89C2051 must perform the first instruction located in its program memory. Therefore, the MCU must undergo a reset upon powering up and this is called the power-on reset. The power-on reset for AT89C2051 will only occur when there is a capacitor across VCC and RST pin and a pulldown resitor from RST to ground. The typical configuration for the RST is shown below.

 

P1.0 – P1.7

Pins P1.0 to P1.7 are the pins of Port1. These pins are bidirectional which means any pin of Port1 can be used as an input pin or an output pin. Pins P1.2 to P1.7 have internal pullups but pins P1.0 and P1.1 require external pullups. However, pins P1.0 and P1.1 are also used as inputs of the on-chip analog comparator.

P3.0 - P3.7

Pins P3.0 to P3.7 are the pins of Port3. Like the Port1, Port3 is also bidirectional and all pins have internal pullups. P3.6 can not be accessed externally because it is hard-wired internally to the output of the on-chip analog comparator. Other functions of the pins of Port3 are shown below: 

Port Pin Alternate Functions
P1.0 AIN0 (positive input) of the on-chip precision analog comparator
P1.1 AIN1 (negative input) of the on-chip precision analog comparator
P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)

 

AT89C2051 Basic Hardware Configuration

The image above shows the summary of what was just discussed and it shows the basic hardware configuration to make AT89C2051 work.

Trackbacks

  1. [...] For an introduction about AT89C2051, see this. [...]

Speak Your Mind

*