Professional Documents
Culture Documents
AT89C52
AT89C52
AT89C52
Features
• Compatible with MCS-51™ Products
• 8K Bytes of In-System Reprogrammable Flash Memory
– Endurance: 1,000 Write/Erase Cycles
• Fully Static Operation: 0 Hz to 24 MHz
• Three-Level Program Memory Lock
• 256 x 8-Bit Internal RAM
• 32 Programmable I/O Lines
• Three 16-Bit Timer/Counters
• Eight Interrupt Sources
• Programmable Serial Channel
• Low Power Idle and Power Down Modes
Description
applications.
Pin Configurations
(T2
PQFP/TQFP
4-62 AT89C52
AT89C52
Block Diagram
4-63
The AT89C52 provides program and data
the following standard memory. In this mode, P0
features: 8K bytes of has internal pullups.
Flash, 256 bytes of RAM, Port 0 also receives the
32 I/O lines, three 16-bit code bytes during Flash
timer/counters, a six- programming and outputs
vector two-level interrupt the code bytes during
architecture, a full duplex program verification.
serial port, on-chip External pullups are
oscillator, and clock required during program
circuitry. In addition, the verification.
AT89C52 is designed with
Port 1
static logic for operation
Port 1 is an 8-bit
down to zero frequency
bidirectional I/O port with
and supports two
internal pullups. The Port
software selectable power
1 output buffers can
saving modes. The Idle
sink/source four TTL
Mode stops the CPU
inputs. When 1s are
while allowing the RAM,
written to Port 1 pins, they
timer/counters, serial port,
are pulled high by the
and interrupt system to internal pullups and can
continue functioning. The be used as inputs. As
Power Down Mode saves inputs, Port 1 pins that are
the RAM contents but externally being pulled low
freezes the oscillator, will source current (IIL)
disabling all other chip because of the internal
functions until the next pullups.
hardware reset.
In addition, P1.0 and P1.1
can be configured to be
Pin Description the timer/counter 2
external count input
VCC
(P1.0/T2) and the
Supply voltage.
timer/counter 2 trigger
GND input (P1.1/T2EX),
Ground. respectively, as shown in
Port 0 the following table.
Port 0 is an 8-bit open Port 1 also receives the
drain bidirectional I/O low-order address bytes
port. As an output port, during Flash
each pin can sink eight programming and
TTL inputs. When 1s are verification.
written to port 0 pins, the
Port Pin Alternate Functions
pins can be used as
highimpedance inputs. P1.0 T2 (external count input to Timer/Counter 2),
Port 0 can also be clock-out
configured to be the P1.1 T2EX (Timer/Counter 2 capture/reload trigger
multiplexed loworder and direction control)
address/data bus during
accesses to external
4-64 AT89C52
AT89C52
Port 2 inputs, Port 3 pins that are
Port 2 is an 8-bit externally being pulled low
bidirectional I/O port with will source current (IIL)
internal pullups. The Port because of the pullups.
2 output buffers can Port 3 also serves the
sink/source four TTL functions of various
inputs. When 1s are special features of the
written to Port 2 pins, they AT89C51, as shown in
are pulled high by the the following table.
internal pullups and can
be used as inputs. As Port 3 also receives some
inputs, Port 2 pins that are control signals for Flash
externally being pulled low programming and
will source current (IIL) verification.
because of the internal Port Pin Alternate Functions
pullups.
P3.0 RXD (serial input port)
Port 2 emits the high-
P3.1 TXD (serial output port)
order address byte during
fetches from external P3.2
program memory and INT0 (external interrupt 0)
during accesses to P3.3
external data memory that
INT1 (external interrupt 1)
use 16-bit addresses
(MOVX @ DPTR). In this P3.4 T0 (timer 0 external input)
application, Port 2 uses P3.5 T1 (timer 1 external input)
strong internal pullups
P3.6
when emitting 1s. During
accesses to external data WR (external data memory write strobe)
memory that use 8-bit P3.7
addresses (MOVX @ RI), RD (external data memory read strobe)
Port 2 emits the contents RST
of the P2 Special Reset input. A high on
Function Register. this pin for two machine
Port 2 also receives the cycles while the oscillator
high-order address bits is running resets the
and some control signals device.
during Flash
programming and ALE/PROG
verification. Address Latch Enable is
Port 3 an output pulse for
Port 3 is an 8-bit latching the low byte of
bidirectional I/O port with the address during
internal pullups. The Port accesses to external
3 output buffers can mem-
sink/source four TTL
inputs. When 1s are ory. This pin is also the
written to Port 3 pins, they program pulse input
are pulled high by the (PROG) during Flash
internal pullups and can programming.
be used as inputs. As
4-65
In normal operation, ALE instruction. Otherwise, the
is emitted at a constant pin is weakly pulled high.
4-66 AT89C52
AT89C52
B
00000000
ACC
00000000
PSW
00000000
IP
XX000000
P3
11111111
IE
0X000000
P2
11111111
SCON SBUF
00000000 XXXXXXXX
P1
11111111
0E8H0EFH 0E0H0E7H
0D8H0DFH
0D0H0D7H
0C8H0CFH 0C0H0C7H
0B8H0BFH
0B0H0B7H
0A8H0AFH 0A0H0A7H
98H9FH
90H97H
4-67
88H8FH
80H87H
Output from the inverting
oscillator amplifier.
4-68 AT89C52
AT89C52
Bit Addressable
C/T2 Timer or counter select for Timer 2. C/T2 = 0 for timer function. C/T2 = 1 for external event counter (falling edge
triggered).
CP/RL2 Capture/Reload select. CP/RL2 = 1 causes captures to occur on negative transitions at T2EX if EXEN2 = 1.
CP/RL2
= 0 causes automatic reloads to occur when Timer 2 overflows or negative transitions occur at T2EX when EXEN2
= 1. When either RCLK or TCLK = 1, this bit is ignored and the timer is forced to auto-reload on Timer 2 overflow.
4-69
Interrupt Registers: The for each of the six
individual interrupt enable interrupt sources in the IP
bits are in the IE register. register.
Two priorities can be set
Data Memory addressing, so the upper
128 bytes of data RAM
The AT89C52 implements
are available as stack
256 bytes of on-chip
space.
RAM. The upper 128
bytes occupy a parallel Timer 0 and 1
address space to the Timer 0 and Timer 1 in
Special Function the AT89C52 operate the
Registers. That means same way as Timer 0 and
the upper 128 bytes have Timer 1 in the AT89C51.
the same addresses as
the SFR space but are
physically separate from Timer 2
SFR space. Timer 2 is a 16-bit
When an instruction Timer/Counter that can
accesses an internal operate as either a timer
location above address or an event counter. The
7FH, the address mode type of operation is
used in the instruction
specifies whether the selected by bit C/T2 in the
CPU accesses the upper SFR T2CON (shown in
128 bytes of RAM or the Table 2). Timer 2 has
SFR space. Instructions three operating modes:
that use direct addressing capture, auto-reload (up
access SFR space. or down counting), and
For example, the baud rate generator. The
following direct modes are selected by
addressing instruction bits in T2CON, as shown
accesses the SFR at in Table 3.
location 0A0H (which is Timer 2 consists of two 8-
P2). bit registers, TH2 and
MOV 0A0H, #data TL2. In the Timer
Instructions that use function, the TL2 register
indirect addressing is incremented every
access the upper 128 machine cycle. Since a
bytes of RAM. For machine cycle consists of
example, the following 12 oscillator periods, the
indirect addressing count rate is 1/12 of the
instruction, where R0 oscillator frequency.
contains 0A0H, accesses Table 3. Timer 2
the data byte at address Operating Modes
0A0H, rather than P2
(whose address is 0A0H). RCLK +TCLK CP/RL2 TR2 MODE
MOV @R0, #data 0 0 1 16-Bit Auto-Reload
Note that stack operations 0 1 1 16-Bit Capture
are examples of indirect
4-70 AT89C52
AT89C52
OSC ÷12
C/T2 = 0
OVERFLOW
CONTROL
TR2
C/T2 = 1
T2 PIN CAPTURE
RCAP2H RCAP2L
TRANSITION
DETECTOR TIMER 2
INTERRUPT
T2EX PIN EXF2
CONTROL
EXEN2
Capture Mode EXEN2 = 1, Timer 2
show a high in one cycle performs the same
and a low in the next operation, but a 1to-0
cycle, the count is transition at external input
incremented. The new T2EX also causes the
count value appears in current value in TH2 and
the register during S3P1 TL2 to be captured into
of the cycle following the RCAP2H and RCAP2L,
one in which the transition respectively. In addition,
was detected. Since two the transition at T2EX
machine cycles (24 causes bit EXF2 in
oscillator periods) are T2CON to be set. The
required to recognize a 1- EXF2 bit, like TF2, can
to-0 transition, the generate an interrupt. The
maximum count rate is capture mode is
1/24 of the oscillator illustrated in Figure 1.
frequency. To ensure that
a given level is sampled
4-71
Auto-Reload (Up or sets the EXF2 bit. Both
Down Counter) the TF2 and EXF2 bits
can generate an interrupt
Timer 2 can be
if enabled.
programmed to count up
or down when configured Setting the DCEN bit
in its 16-bit auto-reload enables Timer 2 to count
mode. This feature is up or down, as shown in
invoked by the DCEN
Figure 3. In this mode, the
(Down Counter Enable)
bit located in the SFR T2EX pin controls Figure
T2MOD (see Table 4). 2. Timer 2 Auto Reload
Upon reset, the DCEN bit Mode (DCEN = 0)
is set to 0 so that timer 2
will default to count up. the direction of the count.
When DCEN is set, Timer A logic 1 at T2EX makes
2 can count up or down, Timer 2 count up. The
depending on the value of timer will overflow at
the T2EX pin. 0FFFFH and set the TF2
bit. This overflow also
Figure 2 shows Timer 2 causes the 16-bit value in
automatically counting up RCAP2H and RCAP2L to
when DCEN = 0. In this be reloaded into the timer
mode, two options are registers, TH2 and TL2,
selected by bit EXEN2 in respectively.
T2CON. If EXEN2 = 0,
Timer 2 counts up to A logic 0 at T2EX makes
0FFFFH and then sets Timer 2 count down. The
the TF2 bit upon overflow. timer underflows when
The overflow also causes TH2 and TL2 equal the
the timer registers to be values stored in RCAP2H
reloaded with the 16-bit and RCAP2L. The
value in RCAP2H and underflow sets the TF2 bit
RCAP2L. The values in and causes 0FFFFH to be
Timer in Capture reloaded into the timer
ModeRCAP2H and registers.
RCAP2L are preset by The EXF2 bit toggles
software. If EXEN2 = 1, a whenever Timer 2
16-bit reload can be overflows or underflows
triggered either by an and can be used as a
overflow or by a 1-to-0 17th bit of resolution. In
transition at external input this operating mode,
T2EX. This transition also EXF2 does not flag an
interrupt.
4-72 AT89C52
AT89C52
OSC ÷12
C/T2 = 0
TH2 TL2
OVERFLOW
CONTROL
TR2
C/T2 = 1
RELOAD
T2 PIN TIMER 2
INTERRUPT
RCAP2H RCAP2L
TF2
TRANSITION
DETECTOR
CONTROL
EXEN2
— — — — — — T2OE DCEN
Bit 7 6 5 4 3 2 1 0
Symbol Function
— Not implemented, reserved for future
T2OE Timer 2 Output Enable bit.
DCEN When set, this bit allows Timer 2 to be configured as an up/down counter.
Figure 3. Timer 2 Auto Reload Mode (DCEN = 1)
4-73
(DOWN COUNTING RELOAD VALUE
) TOGGLE
0FFH 0FFH
EXF2
CONTROL
TR2
C/T2 = 1 TIMER 2
INTERRUPT
T2 PIN
RCAP2H RCAP2L
COUNT
(UP COUNTING RELOAD VALUE
) DIRECTION
1=UP
0=DOWN
T2EX PIN
÷2
"0" "1"
NOTE:OSC.FREQ.IS DIVIDED BY 2, NOT 12
SMOD1
OSC ÷2 C/T2 = 0
"1" "0"
TH2 TL2
RCLK
Rx
CONTROL CLOCK
TR2 ÷ 16
C/T2 = 1
"1" "0"
T2 PIN
TCLK
RCAP2H RCAP2L Tx
CLOCK
TRANSITION
DETECTOR
÷ 16
TIMER 2
T2EX PIN EXF2 INTERRUPT
CONTROL
EXEN2
4-74 AT89C52
AT89C52
4-75
Figure 5. Timer 2 in TCLK = 1 in T2CON. Note
TL2 TH2
OSC ÷2
(8-BITS) (8-BITS)
TR2
RCAP2L RCAP2H
C/T2 BIT
P1.0
÷2
(T2)
T2OE (T2MOD.1)
TRANSITION
DETECTOR
P1.1 TIMER 2
(T2EX) EXF2
INTERRUPT
EXEN2
Clock-Out Mode that a rollover in TH2
increments every state does not set TF2 and will
time (at 1/2 the oscillator not generate an interrupt.
frequency). The baud rate Note too, that if EXEN2 is
formula is given below. set, a 1-to-0 transition in
T2EX will set EXF2 but
Modes 1 and 3
will not cause a reload
Oscillator Frequency
from (RCAP2H, RCAP2L)
--------------------------------------
-= to (TH2, TL2). Thus when
------------------------------------- Timer 2 is in use as a
------------------------------------- baud rate generator,
------------------- T2EX can be used as an
Baud Rate32 × extra external interrupt.
[65536 – (RCAP2H RCAP2L, Note that when Timer 2 is
)] running (TR2 = 1) as a
timer in the baud rate
where (RCAP2H, generator mode, TH2 or
RCAP2L) is the content of TL2 should not be read
RCAP2H and RCAP2L from or written to. Under
taken as a 16-bit these conditions, the
unsigned integer. Timer is incremented
Timer 2 as a baud rate every state time, and the
generator is shown in results of a read or write
Figure 4. This figure is may not be accurate. The
valid only if RCLK or RCAP2 registers may be
4-76 AT89C52
AT89C52
read but should not be
written to, because a write
might overlap a reload
and cause write and/or
reload errors. The timer
should be turned off (clear
TR2) before accessing
the Timer 2 or RCAP2
registers.
4-77
Programmable is possible to use Timer 2
as a baud-rate generator
Clock Out and a clock generator
A 50% duty cycle clock simultaneously. Note,
can be programmed to however, that the baud-
come out on P1.0, as rate and clock-out
shown in Figure 5. This frequencies cannot be
pin, besides being a determined independently
regular I/O pin, has two from one another since
alternate functions. It can they both use RCAP2H
be programmed to input and RCAP2L.
the external clock for
Timer/Counter 2 or to
output a 50% duty cycle UART
clock ranging from 61 Hz The UART in the
to 4 MHz at a 16 MHz AT89C52 operates the
operating frequency. same way as the UART in
To configure the the AT89C51.
Timer/Counter 2 as a
clock generator, bit Interrupts
The AT89C52 has a total
C/T2 (T2CON.1) must be of six interrupt vectors:
cleared and bit T2OE two exter-
(T2MOD.1) must be set.
Bit TR2 (T2CON.2) starts
nal interrupts (INT0 and
and stops the timer.
INT1), three timer
The clock-out frequency interrupts (Timers 0, 1,
depends on the oscillator and 2), and the serial port
frequency and the reload interrupt. These interrupts
value of Timer 2 capture are all shown in Figure 6.
registers (RCAP2H,
Each of these interrupt
RCAP2L), as shown in
sources can be
the following equation.
individually enabled or
Oscill
disabled by setting or
ator
Fequ
clearing a bit in Special
encyFunction Register IE. IE
Clock-Out Frequency= also contains a global
-------------------------------------- disable bit, EA, which
-------------------------------------- disables all interrupts at
-------------- once.
4 Note that Table 5 shows
RCAP2L, that bit position IE.6 is
unimplemented. In the
In the clock-out mode,
AT89C51, bit position IE.5
Timer 2 roll-overs will not
is also unimplemented.
generate an interrupt.
User software should not
This behavior is similar to
write 1s to these bit
when Timer 2 is used as
positions, since they may
a baud-rate generator. It
4-78 AT89C52
AT89C52
be used in future AT89 Table 5. Interrupt Enable
products. (IE) Register
Timer 2 interrupt is
generated by the logical
OR of bits TF2 and EXF2
in register T2CON.
Neither of these flags is
cleared by hardware
when the service routine
is vectored to. In fact, the
service routine may have
to determine whether it
was TF2 or EXF2 that
generated the interrupt,
and that bit will have to be
cleared in software.
The Timer 0 and Timer 1
flags, TF0 and TF1, are
set at S5P2 of the cycle in
which the timers overflow.
The values are then
polled by the circuitry in
the next cycle. However,
the Timer 2 flag, TF2, is
set at S2P2 and is polled
in the same cycle in which
the timer overflows.
(MSB)
(LSB)
EA — ET2 ES ET1 EX1 ET0 EX0
Enable Bit = 1 enables the interrupt.
4-79
Figure 6. Interrupt maximum voltage high
4-80 AT89C52
AT89C52
internal reset algorithm oscillator to restart and
takes control. On-chip stabilize.
hardware inhibits access
Figure 7. Oscillator
to internal RAM in this
Connections
event, but access to the
port pins is not inhibited. C2
To eliminate the XTAL2
possibility of an
unexpected write to a port
pin when idle mode is
terminated by a reset, the C1
instruction following the XTAL1
one that invokes idle
mode should not write to
a port pin or to external
memory. GND
Power Down
Mode
In the power down mode,
the oscillator is stopped, Note: C1, C2 = 30 pF
pF for Crystals
and the instruction that
invokes power down is = 40 pF ±
10 pF for
the last instruction
Ceramic
executed. The on-chip Resonator
RAM and Special s
Function Registers retain
their values until the Figure 8. External Clock
power down mode is Drive Configuration
terminated. The only exit
from power down is a
hardware reset. Reset
redefines the SFRs but
does not change the on-
chip RAM. The reset
should not be activated
before VCC is restored to
its normal operating level
and must be held active
long enough to allow the
Status of External Pins During Idle and Power Down Modes
Mode Program Memory ALE PSEN PORT0 PORT1 PORT2 PORT3
Idle Internal 1 1 Data Data Data Data
Idle External 1 1 Float Data Address Data
Power Down Internal 0 0 Data Data Data Data
Power Down External 0 0 Float Data Data Data
4-81
When lock bit 1 is
NC programmed,
XTAL2 the logic
level at the EA pin is
sampled and latched
during reset. If the device
is powered up without a
EXTERNAL
reset, XTAL1
the latch initializes
OSCILLATOR
SIGNAL to a random value and
holds that value until reset
is activated. The
GND
latched value of EA must
agree with the current
logic level at that pin in
Program Memory order for the device to
Lock Bits function properly.
The AT89C52 has three
lock bits that can be left
unprogrammed (U) or can
Programming the
be programmed (P) to Flash
obtain the additional The AT89C52 is normally
features listed in the shipped with the on-chip
following table. Flash memory array in the
erased state (that is,
contents = FFH) and
Lock Bit ready to be programmed.
Protection The programming
interface accepts either a
Modes high-voltage (12-volt) or a
Program Lock Bits low-voltage (VCC) program
enable signal. The low
LB1 LB2 LB3 voltage programming
mode provides a
1 U U U
convenient way to
2 P U U program the AT89C52
inside the user’s system,
while the high-voltage
programming mode is
compatible with
conventional thirdparty
Flash or EPROM
programmers.
The AT89C52 is shipped
with either the high-
3 P P U voltage or low-voltage
programming mode
enabled. The respective
4 P P P top-side marking and
device signature codes
4-82 AT89C52
AT89C52
are listed in the following The byte-write cycle
table. is self-timed and
typically takes no
VPP = 12V more than 1.5 ms.
Repeat steps 1
Top-Side Mark AT89C52 through 5, changing
xxxx the address and data
yyww for the entire array or
until the end of the
Signature (030H)=1EH
object file is reached.
(031H)=52H
(032H)=FFH
Data Polling: The
The AT89C52 code AT89C52 features Data
memory array is Polling to indicate the end
programmed byte-bybyte of a write cycle. During a
in either programming write cycle, an attempted
mode. To program any read of the last byte
nonblank byte in the on- written will result in the
chip Flash Memory, the complement of the written
entire memory must be data on PO.7. Once the
erased using the Chip write cycle has been
Erase Mode. completed, true data is
Programming valid on all outputs, and
Algorithm: Before
programming the the next cycle may begin.
AT89C52, the address, Data Polling may begin
data and control signals any time after a write
should be set up cycle has been initiated.
according to the Flash
programming mode table Ready/Busy: The
and Figures 9 and 10. To progress of byte
program the AT89C52, programming can also
take the following steps.
1. Input the desired be monitored by the
memory location on RDY/BSY output signal.
the address lines. P3.4 is pulled low after
2. Input the appropriate ALE goes high during
data byte on the data programming to indicate
lines.
3. Activate the correct BUSY. P3.4 is pulled high
combination of control again when programming
signals. is done to indicate
READY.
4. Raise EA/VPP to 12V
for the high-voltage Program Verify: If lock
programming mode. bits LB1 and LB2 have
not been programmed,
5. Pulse ALE/PROG
the programmed code
once to program a
data can be read back via
byte in the Flash
the address and data
array or the lock bits.
4-83
lines for verification. The Flash
lock bits cannot be
verified directly. Programming
Verification of the lock bits Modes
is achieved by observing
that their features are
enabled.
Chip Erase: The entire
Flash array is erased
electrically by using the
proper combination of
control signals and by
4-84 AT89C52
AT89C52
Bit - 2 H L H/12V H H L L
Bit - 3 H L H/12V H L H L
Read Signature H L H H L L L L
Byte
Note: 1. Chip Erase requires a 10-ms PROG pulse.
Figure 9. Programming the Flash Memory
Verifying the Flash Memory
+5V +5V
4-85
Flash Programming and Verification
Characteristics
TA = 0°C to 70°C, VCC = 5.0 ± 10%
Symbol Parameter Min Max Units
VPP(1) Programming Enable Voltage 11.5 12.5 V
IPP(1) Programming Enable Current 1.0 mA
t
tAVGL Address Setup to PROG Low 48 CLCL
t
tGHAX Address Hold After PROG 48 CLCL
t
tDVGL Data Setup to PROG Low 48 CLCL
t
tGHDX Data Hold After PROG 48 CLCL
t
tEHSH P2.7 (ENABLE) High to VPP 48 CLCL
10 µs
tSHGL VPP Setup to PROG Low
tGHSL(1) 10 µs
VPP Hold After PROG
1 110 µs
tGLGH PROG Width
Address to Data Valid t
tAVQV 48 CLCL
t
tELQV ENABLE Low to Data Valid 48 CLCL
0
t
tEHQZ Data Float After ENABLE 48 CLCL
1.0 µs
tGHBL PROG High to BUSY Low
Byte Write Cycle Time 2.0 ms
tWC
Note: 1. Only used in 12-volt programming mode.
4-86 AT89C52
AT89C52
4-87
Flash Programming and Verification
Waveforms - Low Voltage Mode
(VPP=5V)
PROGRAMMING VERIFICATION
P1.0-P1.7
ADDRESS ADDRESS
P2.0-P2.4
tAVQV
PORT0 DATAIN DATAOUT
tDVGL tGHDX
tAVGL tGHAX
ALE/PROG
tSHGL
tGLGH
LOGIC1
EA/VPP LOGIC0
tEHSH tEHQZ
tELQV
P2.7
(ENABLE)
tGHBL
P3.4
(RDY/BSY) BUSY READY
tWC
Absolute Maximum Ratings*
Operating Temperature.................................. -55°C to
to +150°C
4-88 AT89C52
AT89C52
DC Characteristics
The values shown in this table are valid for T A = -40°C to
85°C and VCC = 5.0V ± 20%, unless otherwise noted.
Symbol Parameter Condition Min Max Units
VIH Input High Voltage (Except XTAL1, RST) 0.2 VCC+0.9 VCC+0.5 V
VOH1 Output High Voltage IOH = -800 µA, VCC = 5V ± 10% 2.4 V
(Port 0 in External Bus Mode)
4-89
VCC = 3V 40 µA
Notes: 1. Under
steady state
(non-
transient)
conditions, IOL
must be
externally
limited as
follows:
Maximum IOL
per port pin:
10 mA
Maximum IOL
per 8-bit port:
Port 0: 26 mA Ports 1, 2, 3: 15 mA
Maximum total IOL for all output pins: 71 mA
If IOL exceeds the test condition, VOL may exceed
the related specification. Pins are not guaranteed
to sink current greater than the listed test
conditions.
2. Minimum VCC for Power Down is 2V.
AC Characteristics
Under operating conditions, load capacitance for Port 0,
ALE/PROG, and PSEN = 100 pF; load capacitance for
all other outputs = 80 pF.
4-90 AT89C52
AT89C52
43 ns
tLLPL ALE Low to PSEN Low tCLCL-13
205 3tCLCL-20 ns
tPLPH PSEN Pulse Width
145 3tCLCL-45 ns
tPLIV PSEN Low to Valid Instruction In
0 0 ns
tPXIX Input Instruction Hold After PSEN
59 ns
tPXIZ Input Instruction Float After PSEN tCLCL-10
75 ns
tPXAV PSEN to Address Valid tCLCL-8
Address to Valid Instruction In 312 5tCLCL-55 ns
tAVIV
10 10 ns
tPLAZ PSEN Low to Address Float
400 6tCLCL-100 ns
tRLRH RD Pulse Width
400 6tCLCL-100 ns
tWLWH WR Pulse Width
252 5tCLCL-90 ns
tRLDV RD Low to Valid Data In
0 0 ns
tRHDX Data Hold After RD
97 2tCLCL-28 ns
tRHDZ Data Float After RD
ALE Low to Valid Data In 517 8tCLCL-150 ns
tLLDV
Address to Valid Data In 585 9tCLCL-165 ns
tAVDV
200 300 3tCLCL-50 3tCLCL+50 ns
tLLWL ALE Low to RD or WR Low
203 4tCLCL-75 ns
tAVWL Address to RD or WR Low
23 ns
tQVWX Data Valid to WR Transition tCLCL-20
433 7tCLCL-120 ns
tQVWH Data Valid to WR High
33 ns
tWHQX Data Hold After WR tCLCL-20
4-91
0 0 ns
tRLAZ RD Low to Address Float
43 123 ns
tWHLH RD or WR High to ALE High tCLCL-20 tCLCL+25
External Program Memory Read
Cycle
tLHLL
ALE
tPLPH
tAVLL tLLIV
tLLPL
PSEN tPLIV
tPXAV
tPLAZ
tPXIZ
tLLAX
tPXIX
PORT0 A0-A7 INSTRIN A0-A7
tAVIV
PSEN
tLLDV
tRLRH
tLLWL
RD tLLAX
tRLDV tRHDZ
tAVLL
tRLAZ
tRHDX
tAVWL
tAVDV
PORT 2 P2.0 - P2.7 OR A8 - A15 FROM DPH A8 - A15 FROM PCH
4-92 AT89C52
AT89C52
PSEN
tLLWL tWLWH
WR tLLAX
tAVLL tQVWX tWHQX
tQVWH
tAVWL
High Time 15 ns
tCHCX
Low Time 15 ns
tCLCX
4-93
Rise Time 20 ns
tCLCH
Fall Time 20 ns
tCHCL
Serial Port Timing: Shift Register
Mode Test Conditions
The values in this table are valid for VCC = 5.0V ± 20%
and Load Capacitance = 80 pF.
Symbol Parameter 12 MHz Osc Variable Oscillator Units
INPUTDATA SETRI
4-94 AT89C52
AT89C52
0.2 VCC + 0.9V V LOAD+0.1 V V OL -0.1 V
Note: 1. AC Inputs during testing are driven at VCC - 0.5V for Note: 1. For timing purposes, a port pin is no longer floating
a logic 1 and 0.45V for a logic 0. Timing mea- when a 100 mV change from load voltage occurs. A
surements are made at VIH min. for a logic 1 and
VIL port pin begins to float when a 100 mV
change from max. for a logic 0. the loaded
VOH/VOL level occurs.
Ordering Information
Speed Power
(MHz) Supply Ordering Code Package Operation Range
4-95
AT89C52-20JI 44J 40°C to 85°C)
AT89C52-20PI 40P6
AT89C52-20QI 44Q
Ordering Information
Speed Power Supply
(MHz) Ordering Code Package Operation Range
24 5V ± 20% AT89C52-24AC 44A Commercial
AT89C52-24JC 44J (0°C to 70°C)
AT89C52-24PC 40P6
AT89C52-24QC 44Q
AT89C52-24AI 44A Industrial (-40°C to
AT89C52-24JI 44J 85°C)
AT89C52-24PI 40P6
AT89C52-24QI 44Q
Package Type
4-96 AT89C52