89c51 MCU
89c51 MCU
89c51 MCU
FEATURES OF AT89C51:
4K Bytes of Re-programmable Flash Memory.
RAM is 128 bytes.
2.7V to 6V Operating Range.
Fully Static Operation: 0 Hz to 24 MHz.
Two-level Program Memory Lock.
128 x 8-bit Internal RAM.
32 Programmable I/O Lines.
Two 16-bit Timer/Counters.
Six Interrupt Sources.
Programmable Serial UART Channel.
Low-power Idle and Power-down Modes.
Description:
The AT89C51 is a low-voltage, high-performance CMOS 8-bit microcomputer with 4K
bytes of Flash programmable memory. The device is manufactured using Atmels highdensity nonvolatile memory technology and is compatible with the industry-standard
MCS-51 instruction set. By combining a versatile 8-bit CPU with Flash on a monolithic
chip, the Atmel AT89C51 is a powerful microcomputer, which provides a highly flexible
and cost-effective solution to many embedded control applications.
In addition, the AT89C51 is designed with static logic for operation down to zero
frequency and supports two software selectable power saving modes. The Idle Mode
stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system
to continue functioning. The power-down mode saves the RAM contents but freezes the
oscillator disabling all other chip functions until the next hardware reset.
PIN DESCRIPTION:
Vcc
Pin 40 provides supply voltage to the chip. The voltage source is +5V.
GND
Pin 20 is the ground.
XTAL1 and XTAL2
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that
can be configured for use as an on-chip oscillator, as shown in Figure 11. Either a quartz
crystal or ceramic resonator may be used. To drive the device from an external clock
source, XTAL2 should be left unconnected while XTAL1 is driven, as shown in the
below figure. There are no requirements on the duty cycle of the external clock signal,
since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but
minimum and maximum voltage high and low time specifications must be observed.
RESET
Pin9 is the reset pin. It is an input and is active high. Upon applying a high pulse to this
pin, the microcontroller will reset and terminate all the activities. This is often referred to
as a power-on reset.
EA (External access)
Pin 31 is EA. It is an active low signal. It is an input pin and must be connected to either
Vcc or GND but it cannot be left unconnected.
The 8051 family members all come with on-chip ROM to store programs. In such cases,
the EA pin is connected to Vcc. If the code is stored on an external ROM, the EA pin
must be connected to GND to indicate that the code is stored externally.
Port 3 occupies a total of 8 pins, pins 10 through 17. It can be used as input or output. P3
does not need any pull-up resistors, the same as port 1 and port 2. Port 3 has an additional
function of providing some extremely important signals such as interrupts.
The AT89C51 code memory array is programmed byte-byte in either programming mode.
To program any nonblank byte in the on-chip Flash Memory, the entire memory must be
erased using the Chip Erase Mode.
Programming Algorithm:
Before programming the AT89C51, the address, data and control signals should be set up
according to the Flash programming mode table. To program the AT89C51, the following
steps should be considered: