8-Bit Microcontroller With 2K Bytes Flash AT89C2051: Features
8-Bit Microcontroller With 2K Bytes Flash AT89C2051: Features
8-Bit Microcontroller With 2K Bytes Flash AT89C2051: Features
Pin Configuration
PDIP/SOIC
RST/VPP 1 20 VCC
(RXD) P3.0 2 19 P1.7
(TXD) P3.1 3 18 P1.6
XTAL2 4 17 P1.5
XTAL1 5 16 P1.4
(INT0) P3.2 6 15 P1.3
(INT1) P3.3 7 14 P1.2
(TO) P3.4 8 13 P1.1 (AIN1)
(T1) P3.5 9 12 P1.0 (AIN0)
GND 10 11 P3.7
Rev. 0368E–02/00
1
Block Diagram
2 AT89C2051
AT89C2051
XTAL1
VCC
Input to the inverting oscillator amplifier and input to the
Supply voltage.
internal clock operating circuit.
GND
XTAL2
Ground.
Output from the inverting oscillator amplifier.
Port 1
Port 1 is an 8-bit bi-irectional I/O port. Port pins P1.2 to Oscillator Characteristics
P1.7 provide internal pullups. P1.0 and P1.1 require exter-
XTAL1 and XTAL2 are the input and output, respectively,
nal pullups. P1.0 and P1.1 also serve as the positive input
of an inverting amplifier which can be configured for use as
(AIN0) and the negative input (AIN1), respectively, of the
an on-chip oscillator, as shown in Figure 1. Either a quartz
on-chip precision analog comparator. The Port 1 output
crystal or ceramic resonator may be used. To drive the
buffers can sink 20 mA and can drive LED displays directly.
device from an external clock source, XTAL2 should be left
When 1s are written to Port 1 pins, they can be used as
unconnected while XTAL1 is driven as shown in Figure 2.
inputs. When pins P1.2 to P1.7 are used as inputs and are
There are no requirements on the duty cycle of the external
externally pulled low, they will source current (IIL) because
clock signal, since the input to the internal clocking circuitry
of the internal pullups.
is through a divide-by-two flip-flop, but minimum and maxi-
Port 1 also receives code data during Flash programming mum voltage high and low time specifications must be
and verification. observed.
RST
Reset input. All I/O pins are reset to 1s as soon as RST
goes high. Holding the RST pin high for two machine
cycles while the oscillator is running resets the device.
3
Special Function Registers
A map of the on-chip memory area called the Special Func- random data, and write accesses will have an indetermi-
tion Register (SFR) space is shown in the table below. nate effect.
Note that not all of the addresses are occupied, and unoc- User software should not write 1s to these unlisted loca-
cupied addresses may not be implemented on the chip. tions, since they may be used in future products to invoke
Read accesses to these addresses will in general return new features. In that case, the reset or inactive values of
the new bits will always be 0.
Table 1. AT89C2051 SFR Map and Reset Values
0F8H 0FFH
0F0H B 0F7H
00000000
0E8H 0EFH
0C0H 0C7H
0B8H IP 0BFH
XXX00000
0B0H P3 0B7H
11111111
0A8H IE 0AFH
0XX00000
0A0H 0A7H
4 AT89C2051
AT89C2051
5
Programming The Flash the next cycle may begin. Data Polling may begin any time
after a write cycle has been initiated.
The AT89C2051 is shipped with the 2K bytes of on-chip
Ready/Busy: The Progress of byte programming can also
PEROM code memory array in the erased state (i.e., con-
be monitored by the RDY/BSY output signal. Pin P3.1 is
tents = FFH) and ready to be programmed. The code
pulled low after P3.2 goes High during programming to indi-
memory array is programmed one byte at a time. Once the
cate BUSY. P3.1 is pulled High again when programming is
array is programmed, to re-program any non-blank byte,
done to indicate READY.
the entire memory array needs to be erased electrically.
Program Verify: If lock bits LB1 and LB2 have not been
Internal Address Counter: The AT89C2051 contains an
programmed code data can be read back via the data lines
internal PEROM address counter which is always reset to
for verification:
000H on the rising edge of RST and is advanced by apply-
1. Reset the internal address counter to 000H by bringing
ing a positive going pulse to pin XTAL1.
RST from “L” to “H”.
Programming Algorithm: To program the AT89C2051,
2. Apply the appropriate control signals for Read Code data
the following sequence is recommended. and read the output data at the port P1 pins.
1. Power-up sequence:
3. Pulse pin XTAL1 once to advance the internal address
Apply power between VCC and GND pins
counter.
Set RST and XTAL1 to GND
4. Read the next code data byte at the port P1 pins.
2. Set pin RST to “H”
Set pin P3.2 to “H” 5. Repeat steps 3 and 4 until the entire array is read.
3. Apply the appropriate combination of “H” or “L” logic The lock bits cannot be verified directly. Verification of the
levels to pins P3.3, P3.4, P3.5, P3.7 to select one of the lock bits is achieved by observing that their features are
programming operations shown in the PEROM Pro- enabled.
gramming Modes table. Chip Erase: The entire PEROM array (2K bytes) and the
To Program and Verify the Array: two Lock Bits are erased electrically by using the proper
4. Apply data for Code byte at location 000H to P1.0 to combination of control signals and by holding P3.2 low for
P1.7. 10 ms. The code array is written with all “1”s in the Chip
5. Raise RST to 12V to enable programming. Erase operation and must be executed before any non-
6. Pulse P3.2 once to program a byte in the PEROM array blank memory byte can be re-programmed.
or the lock bits. The byte-write cycle is self-timed and Reading the Signature Bytes: The signature bytes are
typically takes 1.2 ms. read by the same procedure as a normal verification of
7. To verify the programmed data, lower RST from 12V to locations 000H, 001H, and 002H, except that P3.5 and
logic “H” level and set pins P3.3 to P3.7 to the appropiate P3.7 must be pulled to a logic low. The values returned are
levels. Output data can be read at the port P1 pins. as follows.
8. To program a byte at the next address location, pulse (000H) = 1EH indicates manufactured by Atmel
XTAL1 pin once to advance the internal address (001H) = 21H indicates 89C2051
counter. Apply new data to the port P1 pins.
9. Repeat steps 5 through 8, changing data and advancing
the address counter for the entire 2K bytes array or until Programming Interface
the end of the object file is reached. Every code byte in the Flash array can be written and the
10.Power-off sequence: entire array can be erased by using the appropriate combi-
set XTAL1 to “L” nation of control signals. The write operation cycle is self-
set RST to “L” timed and once initiated, will automatically time itself to
Turn VCC power off completion.
Data Polling: The AT89C2051 features Data Polling to All major programming vendors offer worldwide support for
indicate the end of a write cycle. During a write cycle, an the Atmel microcontroller series. Please contact your local
attempted read of the last byte written will result in the com- programming vendor for the appropriate software revision.
plement of the written data on P1.7. Once the write cycle
has been completed, true data is valid on all outputs, and
6 AT89C2051
AT89C2051
Bit - 2 12V H H L L
Figure 3. Programming the Flash Memory Figure 4. Verifying the Flash Memory
PP
7
Flash Programming and Verification Characteristics
TA = 0°C to 70°C, VCC = 5.0 ± 10%
Symbol Parameter Min Max Units
VPP Programming Enable Voltage 11.5 12.5 V
IPP Programming Enable Current 250 µA
tDVGL Data Setup to PROG Low 1.0 µs
tGHDX Data Hold after PROG 1.0 µs
tEHSH P3.4 (ENABLE) High to VPP 1.0 µs
tSHGL VPP Setup to PROG Low 10 µs
tGHSL VPP Hold after PROG 10 µs
tGLGH PROG Width 1 110 µs
tELQV ENABLE Low to Data Valid 1.0 µs
tEHQZ Data Float after ENABLE 0 1.0 µs
tGHBL PROG High to BUSY Low 50 ns
tWC Byte Write Cycle Time 2.0 ms
tBHIH RDY/BSY\ to Increment Clock Delay 1.0 µs
tIHIL Increment Clock High 200 ns
Note: 1. Only used in 12-volt programming mode.
8 AT89C2051
AT89C2051
DC Characteristics
TA = -40°C to 85°C, VCC = 2.0V to 6.0V (unless otherwise noted)
Symbol Parameter Condition Min Max Units
VIL Input Low-voltage -0.5 0.2 VCC - 0.1 V
VIH Input High-voltage (Except XTAL1, RST) 0.2 VCC + 0.9 VCC + 0.5 V
VIH1 Input High-voltage (XTAL1, RST) 0.7 VCC VCC + 0.5 V
VOL Output Low-voltage(1) IOL = 20 mA, VCC = 5V 0.5 V
(Ports 1, 3) IOL = 10 mA, VCC = 2.7V
9
External Clock Drive Waveforms
10 AT89C2051
AT89C2051
()
Note: 1. AC Inputs during testing are driven at VCC - 0.5V for a Note: 1. For timing purposes, a port pin is no longer floating
logic 1 and 0.45V for a logic 0. Timing measurements when a 100 mV change from load voltage occurs. A
are made at VIH min. for a logic 1 and VIL max. for a port pin begins to float when 100 mV change frothe
logic 0. loaded VOH/VOL level occurs.
11
AT89C2051
TYPICAL ICC - ACTIVE (85°C)
20
Vcc=6.0V
I 15
C Vcc=5.0V
C 10
Vcc=3.0V
m
A 5
0
0 6 12 18 24
FREQUENCY (MHz)
AT89C2051
TYPICAL ICC - IDLE (85°C)
3
Vcc=6.0V
I
C 2 Vcc=5.0V
C
m 1
A
Vcc=3.0V
0
0 3 6 9 12
FREQUENCY (MHz)
AT89C2051
TYPICAL ICC vs. VOLTAGE- POWER DOWN (85°C)
20
I 15
C
C 10
µ
A 5
0
3.0V 4.0V 5.0V 6.0V
Vcc VOLTAGE
12 AT89C2051
AT89C2051
Ordering Information
Speed Power
(MHz) Supply Ordering Code Package Operation Range
12 2.7V to 6.0V AT89C2051-12PC 20P3 Commercial
AT89C2051-12SC 20S (0°C to 70°C)
AT89C2051-12PI 20P3 Industrial
AT89C2051-12SI 20S (-40°C to 85°C)
24 4.0V to 6.0V AT89C2051-24PC 20P3 Commercial
AT89C2051-24SC 20S (0°C to 70°C)
AT89C2051-24PI 20P3 Industrial
AT89C2051-24SI 20S (-40°C to 85°C)
Package Type
20P3 20-lead, 0.300” Wide, Plastic Dual In-line Package (PDIP)
20S 20-lead, 0.300” Wide, Plastic Gull Wing Small Outline (SOIC)
13
Packaging Information
20P3, 20-lead, 0.300" Wide, Plastic Dual Inline 20S, 20-lead, 0.300" Wide, Plastic Gull WIng Small
Package (PDIP) Outline (SOIC)
Dimensions in Inches and (Millimeters) Dimensions in Inches and (Millimeters)
JEDEC STANDARD MS-001 AD
.090(2.29)
.900(22.86) REF MAX
.050 (1.27) BSC
.210(5.33) .005(.127)
MAX MIN
SEATING
PLANE 0.513 (13.0)
0.497 (12.6) 0.105 (2.67)
.150(3.81) .015(.381) MIN 0.092 (2.34)
.115(2.92) .022(.559)
.014(.356)
.070(1.78)
.110(2.79) 0.012 (0.305)
.045(1.13)
.090(2.29) 0.003 (0.076)
.325(8.26)
.300(7.62)
0
REF 0.013 (0.330)
0 REF 8
0.009 (0.229)
.014(.356) 15
.008(.203)
0.035 (0.889)
.430(10.92) MAX 0.015 (0.381)
14 AT89C2051
Atmel Headquarters Atmel Operations
Corporate Headquarters Atmel Colorado Springs
2325 Orchard Parkway 1150 E. Cheyenne Mtn. Blvd.
San Jose, CA 95131 Colorado Springs, CO 80906
TEL (408) 441-0311 TEL (719) 576-3300
FAX (408) 487-2600 FAX (719) 540-1759
Europe Atmel Rousset
Atmel U.K., Ltd. Zone Industrielle
Coliseum Business Centre 13106 Rousset Cedex
Riverside Way France
Camberley, Surrey GU15 3YL TEL (33) 4-4253-6000
England FAX (33) 4-4253-6001
TEL (44) 1276-686-677
FAX (44) 1276-686-697
Asia
Atmel Asia, Ltd.
Room 1219
Chinachem Golden Plaza
77 Mody Road Tsimhatsui
East Kowloon
Hong Kong
TEL (852) 2721-9778
FAX (852) 2722-1369
Japan
Atmel Japan K.K.
9F, Tonetsu Shinkawa Bldg.
1-24-8 Shinkawa
Chuo-ku, Tokyo 104-0033
Japan
TEL (81) 3-3523-3551
FAX (81) 3-3523-7581
Fax-on-Demand
North America:
1-(800) 292-8635
International:
1-(408) 441-0732
e-mail
[email protected]
Web Site
http://www.atmel.com
BBS
1-(408) 436-4309