Sunteți pe pagina 1din 3

1

2
3
40
39
38
8-bit
Microcontrolle
4 37
5 36
6 35

r
7 34
8 33
9 32

Features 10 31

• Compatible with MCS-51™ Products


11
12
13
30
29
28
with 4K Bytes
• 4K Bytes of In-System Reprogrammable Flash Memory
Flash
14 27
15 26
– Endurance: 1,000 Write/Erase Cycles 16 25
17 24
• Fully Static Operation: 0 Hz to 24 MHz 18 23
• Three-level Program Memory Lock 19
20
22
21
• 128 x 8-bit Internal RAM
• 32 Programmable I/O Lines
• Two 16-bit Timer/Counters
• Six Interrupt Sources
• Programmable Serial Channel
• Low-power Idle and Power-down Modes

Description
The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K
bytes of Flash programmable and erasable read only memory (PEROM). The device
is manufactured using Atmel’s high-density nonvolatile memory technology and is
compatible with the industry-standard MCS-51 instruction set and pinout. The on-chip
Flash allows the program memory to be reprogrammed in-system or by a conven-
tional nonvolatile memory programmer. 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.

PDIP
Pin Configurations
P1.0 VCC
P1.1 P0.0 (AD0)
P1.2 P0.1 (AD1)
P1.3 P0.2 (AD2)
P1.4 P0.3 (AD3)
P1.5 P0.4 (AD4)
P1.6 P0.5 (AD5)
P1.7 P0.6 (AD6)
RST P0.7 (AD7)
PQFP/TQF (RXD) P3.0 EA/VPP

P (TXD) P3.1
(INT0) P3.2
ALE/PROG
PSEN
(INT1) P3.3 P2.7 (A15)
(T0) P3.4 P2.6 (A14)
(T1) P3.5 P2.5 (A13)
(WR) P3.6 P2.4 (A12)
(RD) P3.7 P2.3 (A11)
XTAL2 P2.2 (A10)
XTAL1 P2.1 (A9)
33 PO.4 (AD4) GND P2.0 (A8)
P1.5 1 32 P0.5 (AD5)
P1.6 2 31 P0.6 (AD6)
P1.7 3 30 P0.7 (AD7) PLCC
RST 4 29 EA/VPP
(RXD) P3.0 5 28 NC
NC 6 27 ALE/PROG
(TXD) P3.1 7 26 PSEN
(INT0) P3.2 8 25 P2.7 (A15)
(INT1) P3.3 9 24 P2.6 (A14)
(T0) P3.4 10 23 P2.5 (A13)
P1.5 7 39 PO.4 (AD4)
P1.6 8 38 P0.5 (AD5)
P1.7 9 37 P0.6 (AD6)
RST 10 36 P0.7 (AD7)
(RXD) P3.0 11 35 EA/VPP
NC 12 34 NC
(TXD) P3.1 13 33 ALE/PROG
(INT0) P3.2 14 32 PSEN
(INT1) P3.3 15 31 P2.7 (A15)
(T0) P3.4 16 30 P2.6 (A14)
(T1) P3.5 17 29 P2.5 (A13)

Rev. 0265G–02/00
PORT 0 DRIVERS PORT 2 DRIVERS

Block Diagram RAM ADDR. PORT 0 PORT 2


REGISTER RAM LATCH LATCH FLASH

P0.0 - P0.7 P2.0 - P2.7

VCC

GND
PROGRAM
B STACK
ACC ADDRESS
REGISTER POINTER
REGISTER

BUFFER
TMP2 TMP1

PC
ALU INCREMENTER

INTERRUPT, SERIAL PORT,


AND TIMER BLOCKS

PROGRAM
PSW COUNTER

TIMING
AND INSTRUCTION DPTR
CONTROL REGISTER

PORT 1 PORT 3
LATCH LATCH

OSC
PSEN PORT 1 DRIVERS PORT 3 DRIVERS
ALE/PROG
EA / VPP
RST
P1.0 -
P1.7

AT89C51
P3.0 - P3.7

2
AT89C51

The AT89C51 provides the following standard features: 4K Port 2 pins that are externally being pulled low will source
bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit current (IIL) because of the internal pullups.
timer/counters, a five vector two-level interrupt architecture, Port 2 emits the high-order address byte during
a full duplex serial port, on-chip oscillator and clock cir- fetches
cuitry. In addition, the AT89C51 is designed with static logic from external program memory and during accesses to
for operation down to zero frequency and supports two external data memory that use 16-bit addresses (MOVX @
software selectable power saving modes. The Idle Mode DPTR). In this application, it uses strong internal pullups
stops the CPU while allowing the RAM, timer/counters, when emitting 1s. During accesses to external data mem-
serial port and interrupt system to continue functioning. The ory that use 8-bit addresses (MOVX @ RI), Port 2 emits the
Power-down Mode saves the RAM contents but freezes contents of the P2 Special Function Register.
the oscillator disabling all other chip functions until the next
Port 2 also receives the high-order address bits and some
hardware reset.
control signals during Flash programming and verification.

Pin Description Port 3


Port 3 is an 8-bit bi-directional I/O port with internal pullups.
VCC The Port 3 output buffers can sink/source four TTL inputs.
When 1s are written to Port 3 pins they are pulled high by
Supply voltage.
the internal pullups and can be used as inputs. As inputs,
Port 3 pins that are externally being pulled low will source
GND
current (IIL) because of the pullups.
Ground.
Port 3 also serves the functions of various special features
of the AT89C51 as listed below:
Port 0
Port 0 is an 8-bit open-drain bi-directional I/O port. As an
Port Pin Alternate Functions
output port, each pin can sink eight TTL inputs. When 1s
are written to port 0 pins, the pins can be used as high- P3.0 RXD (serial input port)
impedance inputs.
P3.1 TXD (serial output port)
Port 0 may also be configured to be the multiplexed low-
P3.2 INT0 (external interrupt 0)
order address/data bus during accesses to external pro-
gram and data memory. In this mode P0 has internal P3.3 INT1 (external interrupt 1)
pullups.
P3.4 T0 (timer 0 external input)
Port 0 also receives the code bytes during Flash program-
P3.5 T1 (timer 1 external input)
ming, and outputs the code byt es during program
verification. External pullups are required during program P3.6 WR (external data memory write strobe)
verification.
P3.7 RD (external data memory read strobe)

Port 1
Port 3 also receives some control signals for Flash
Port 1 is an 8-bit bi-directional I/O port with internal pullups. pro-
The Port 1 output buffers can sink/source four TTL inputs. gramming and verification.
When 1s are written to Port 1 pins they are pulled high by
the internal pullups and can be used as inputs. As inputs, RST
Port 1 pins that are externally being pulled low will source
Reset input. A high on this pin for two machine cycles while
current (IIL) because of the internal pullups.
the oscillator is running resets the device.
Port 1 also receives the low-order address bytes during
Flash programming and verification. ALE/PROG
Address Latch Enable output pulse for latching the low byte
Port 2
of the address during accesses to external memory. This
Port 2 is an 8-bit bi-directional I/O port with internal pullups. pin is also the program pulse input (PROG) during Flash
The Port 2 output buffers can sink/source four TTL inputs. programming.
When 1s are written to Port 2 pins they are pulled high by
In normal operation ALE is emitted at a constant rate of 1/6
the internal pullups and can be used as inputs. As inputs,
the oscillator frequency, and may be used for external tim-
ing or clocking purposes. Note, however, that one ALE

S-ar putea să vă placă și