Features
•
80C52 Compatible
– 8051 Instruction Compatible
– Six 8-bit I/O Ports (64 Pins or 68 Pins Versions)
– Four 8-bit I/O Ports (44 Pins Version)
– Three 16-bit Timer/Counters
– 256 Bytes Scratch Pad RAM
– 9 Interrupt Sources with 4 Priority Levels
Integrated Power Monitor (POR/PFD) to Supervise Internal Power Supply
ISP (In-System Programming) Using Standard V
CC
Power Supply
2048 Bytes Boot ROM Contains Low Level Flash Programming Routines and a Default
Serial Loader
High-speed Architecture
– In Standard Mode:
40 MHz (Vcc 2.7V to 5.5V, both Internal and external code execution)
60 MHz (Vcc 4.5V to 5.5V and Internal Code execution only)
– In X2 mode (6 Clocks/machine cycle)
20 MHz (Vcc 2.7V to 5.5V, both Internal and external code execution)
30 MHz (Vcc 4.5V to 5.5V and Internal Code execution only)
64K Bytes On-chip Flash Program/Data Memory
– Byte and Page (128 Bytes) Erase and Write
– 100k Write Cycles
On-chip 1792 bytes Expanded RAM (XRAM)
– Software Selectable Size (0, 256, 512, 768, 1024, 1792 Bytes)
– 768 Bytes Selected at Reset for T89C51RD2 Compatibility
On-chip 2048 Bytes EEPROM Block for Data Storage (AT89C51ED2 Only)
– 100K Write Cycles
Dual Data Pointer
Variable Length MOVX for Slow RAM/Peripherals
Improved X2 Mode with Independent Selection for CPU and Each Peripheral
Keyboard Interrupt Interface on Port 1
SPI Interface (Master/Slave Mode)
8-bit Clock Prescaler
16-bit Programmable Counter Array
– High Speed Output
– Compare/Capture
– Pulse Width Modulator
– Watchdog Timer Capabilities
Asynchronous Port Reset
Full-duplex Enhanced UART with Dedicated Internal Baud Rate Generator
Low EMI (Inhibit ALE)
Hardware Watchdog Timer (One-time Enabled with Reset-Out), Power-off Flag
Power Control Modes: Idle Mode, Power-down Mode
Single Range Power Supply: 2.7V to 5.5V
Industrial Temperature Range (-40 to +85°C)
Packages: PLCC44, VQFP44, PLCC68, VQFP64, PDIL40
•
•
•
•
8-bit Flash
Microcontroller
AT89C51RD2
AT89C51ED2
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Description
AT89C51RD2/ED2 is high performance CMOS Flash version of the 80C51 CMOS sin-
gle chip 8-bit microcontroller. It contains a 64-Kbyte Flash memory block for code and
for data.
The 64-Kbytes Flash memory can be programmed either in parallel mode or in serial
mode with the ISP capability or with software. The programming voltage is internally
generated from the standard V
CC
pin.
Rev. 4235E–8051–04/04
1
The AT89C51RD2/ED2 retains all of the features of the Atmel 80C52 with 256 bytes of
internal RAM, a 9-source 4-level interrupt controller and three timer/counters. The
AT89C51ED2 provides 2048 bytes of EEPROM for nonvolatile data storage.
In addition, the AT89C51RD2/ED2 has a Programmable Counter Array, an XRAM of
1792 bytes, a Hardware Watchdog Timer, SPI interface, Keyboard, a more versatile
serial channel that facilitates multiprocessor communication (EUART) and a speed
improvement mechanism (X2 Mode).
The fully static design of the AT89C51RD2/ED2 allows to reduce system power con-
sumption by bringing the clock frequency down to any value, including DC, without loss
of data.
The AT89C51RD2/ED2 has 2 software-selectable modes of reduced activity and an 8-
bit clock prescaler for further reduction in power consumption. In the Idle mode the CPU
is frozen while the peripherals and the interrupt system are still operating. In the Power-
down mode the RAM is saved and all other functions are inoperative.
The added features of the AT89C51RD2/ED2 make it more powerful for applications
that need pulse width modulation, high speed I/O and counting capabilities such as
alarms, motor control, corded phones, and smart card readers.
Table 1.
Memory Size and I/O Pins
Package
PLCC44/VQFP44/DIL40
PLCC68/VQFP64
Flash (Bytes)
64K
64K
XRAM (Bytes)
1792
1792
Total RAM (Bytes)
2048
2048
I/O
34
50
2
AT89C51RD2/ED2
4235E–8051–04/04
AT89C51RD2/ED2
Block Diagram
Figure 1.
Block Diagram
T2EX
Keyboard
(1)
VCC
PCA
RxD
TxD
VSS
ECI
(2) (2)
(1)
(1) (1)
(1)
XTALA1
XTALA2
EUART
RAM
256x8
Flash
64K x 8
XRAM
1792 x 8
T2
PCA
Timer2
Keyboard
Watch
-dog
EEPROM*
2K x 8
(AT89C51ED2)
C51
CORE
IB-bus
ALE/ PROG
PSEN
EA
RD
WR
(2)
(2)
CPU
Parallel I/O Ports &
Timer 0
Timer 1
INT
Ctrl
External Bus
Port 0 Port 1
Port 2
Port 3 Port4 Port 5
SPI
BOOT Regulator
2K x 8 POR / PFD
ROM
(2) (2)
T0
RESET
T1
(2) (2)
P1
P2
P0
P3
INT0
INT1
P4
P5
(1) (1) (1)(1)
MISO
MOSI
SCK
SS
(1): Alternate function of Port 1
(2): Alternate function of Port 3
3
4235E–8051–04/04
SFR Mapping
The Special Function Registers (SFRs) of the AT89C51RD2/ED2 fall into the following
categories:
•
•
•
•
•
•
•
•
•
•
•
•
•
C51 core registers: ACC, B, DPH, DPL, PSW, SP
I/O port registers: P0, P1, P2, P3, PI2
Timer registers: T2CON, T2MOD, TCON, TH0, TH1, TH2, TMOD, TL0, TL1, TL2,
RCAP2L, RCAP2H
Serial I/O port registers: SADDR, SADEN, SBUF, SCON
PCA (Programmable Counter Array) registers: CCON, CCAPMx, CL, CH, CCAPxH,
CCAPxL (x: 0 to 4)
Power and clock control registers: PCON
Hardware Watchdog Timer registers: WDTRST, WDTPRG
Interrupt system registers: IE0, IPL0, IPH0, IE1, IPL1, IPH1
Keyboard Interface registers: KBE, KBF, KBLS
SPI registers: SPCON, SPSTR, SPDAT
BRG (Baud Rate Generator) registers: BRL, BDRCON
Clock Prescaler register: CKRL
Others: AUXR, AUXR1, CKCON0, CKCON1
4
AT89C51RD2/ED2
4235E–8051–04/04
AT89C51RD2/ED2
Table 2.
C51 Core SFRs
Mnemonic
ACC
B
PSW
SP
DPL
DPH
Add
E0h
F0h
D0h
81h
82h
83h
Name
Accumulator
B Register
Program Status Word
Stack Pointer
Data Pointer Low Byte
Data Pointer High Byte
CY
AC
F0
RS1
RS0
OV
F1
P
7
6
5
4
3
2
1
0
Table 3.
System Management SFRs
Mnemonic
PCON
AUXR
AUXR1
CKRL
CKCKON0
CKCKON1
Add
87h
8Eh
A2h
97h
8Fh
AFh
Name
Power Control
Auxiliary Register 0
Auxiliary Register 1
Clock Reload Register
Clock Control Register 0
Clock Control Register 1
7
SMOD1
DPU
-
-
-
-
6
SMOD0
-
-
-
WDTX2
-
5
-
M0
ENBOOT
4
POF
XRS2
-
-
SIX2
-
3
GF1
XRS1
GF3
-
T2X2
-
2
GF0
XRS0
0
-
T1X2
-
1
PD
EXTRAM
-
-
T0X2
-
0
IDL
AO
DPS
-
X2
SPIX2
-
PCAX2
-
Table 4.
Interrupt SFRs
Mnemonic
IEN0
IEN1
IPH0
IPL0
IPH1
IPL1
Add
A8h
B1h
B7h
B8h
B3h
B2h
Name
Interrupt Enable Control 0
Interrupt Enable Control 1
Interrupt Priority Control High 0
Interrupt Priority Control Low 0
Interrupt Priority Control High 1
Interrupt Priority Control Low 1
7
EA
-
-
-
-
-
6
EC
-
PPCH
PPCL
-
-
5
ET2
-
PT2H
PT2L
-
-
4
ES
-
PHS
PLS
-
-
3
ET1
-
PT1H
PT1L
-
-
2
EX1
ESPI
PX1H
PX1L
SPIH
SPIL
PT0H
PT0L
1
ET0
0
EX0
KBD
PX0H
PX0L
KBDH
KBDL
Table 5.
Port SFRs
Mnemonic
P0
P1
P2
P3
P4
Add
80h
90h
A0h
B0h
C0h
Name
8-bit Port 0
8-bit Port 1
8-bit Port 2
8-bit Port 3
8-bit Port 4
7
6
5
4
3
2
1
0
5
4235E–8051–04/04