4K Bytes of Factory Programmable QuickFlash™ Memory
•
Fully Static Operation: 0 Hz to 20 MHz
•
Three-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 Channel
•
Low Power Idle and Power Down Modes
•
8-Bit
Description
The AT80F51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K
bytes of Qui ckF lash Memo ry. The dev ice i s m anuf actu red u sin g A tmel ’s hi gh d ens ity
nonvolatile memory technology and is compatible with the industry standard MCS51™ instruction set and pinout. The on-chip Quic kFlash allows cu stom codes to be
quickly programmed in the factory. By combining a versatile 8-bit CPU with QuickFlash on a monolithic chip, the Atmel AT80F51 is a powerful microcomputer which
provides a highly flex ible and co st effe ctive solu tion to many embedd ed con trol app lications.
The AT80F51 provides the following standard features: 4K
bytes of QuickFlash, 128 bytes of RAM, 32 I/O lines, two
16-bit timer/counters, a fiv e vector two-level interrup t architecture, a full duplex serial port, on-chip oscillator and clock
circuitry. In addition, the AT80F51 is designed with static
logic for operation down to zero frequency an d supports
two software select able power saving mo des. 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 os cillato r dis ablin g all othe r chip func tions until the next hardware reset.
Pin Description
V
CC
Supply voltage.
GND
Ground.
Port 0
Port 0 is an 8-bit open drain bidirectional I/O port. As an
output port each pin can sink eight TTL inputs. When 1s
are written to port 0 pins, the pins can be used as highimpedance inputs.
Port 0 may also be configured to be the multiplexed loworder address/data bus during accesses to ex ternal program and data memory . In this m ode P0 ha s int ernal pullups.
Port 0 also out puts the c ode b yt es d uring p ro gram verification. External pu llups are requ ired dur ing pro gram ver ification.
Port 1
Port 1 is an 8-bit bidire ction al I/O por t w ith inter nal pullu ps.
The Port 1 output buffers can sink/source four TTL inputs.
When 1s are written to Port 1 pins they are pulled high by
the internal pullups and can be used as inputs. As inputs ,
Port 1 pins that are externally being pulled low will source
current (I
Port 1 also receives the low-order address bytes during
QuickFlash verification.
Port 2
Port 2 is an 8-bit bidire ction al I/O por t w ith inter nal pullu ps.
The Port 2 output buffers can sink/source four TTL inputs.
When 1s are written to Port 2 pins they are pulled high by
the internal pullups and can be used as inputs. As inputs ,
Port 2 pins that are externally being pulled low will source
current (I
Port 2 emits the high-order address byte during fetches
from external program memory and during accesses to
external data memory that use 16-bit addre sses ( MOVX @
DPTR). In this ap plication it uses strong internal pull ups
when emitting 1s. During accesses to external data mem-
) because of the internal pullups.
IL
) because of the internal pullups.
IL
ory that use 8-bit addresses (MOVX @ RI), Port 2 emits the
contents of the P2 Special Function Register.
Port 2 also receives the high-order address bits and some
control signals during QuickFlash verification.
Port 3
Port 3 is an 8-bit bidirectional I/O port with interna l pullups.
The Port 3 output buffers can sink/source four TTL inputs.
When 1s are written to Port 3 pins they are pulled high by
the internal pullups and can be used as inputs. As inputs,
Port 3 pins that are externally being pulled low will source
current (I
) because of the pullups.
IL
Port 3 also serv es t he fun ctions of v arious spe cial f eatures
of the AT80F51 as listed below:
Port 3 also receives some control signals for QuickFlash
verification.
RST
Reset input. A high on this pin for two machine cycles while
the oscillator is running resets the device.
ALE
Address Latch Enable output pulse for latching the low byte
of the address during accesses to external memory.
In normal operation ALE is emitted at a constant rate of 1/6
the oscillator fr equen cy, an d may be us ed for ex ternal timing or clocking purposes. Note, however, that one ALE
pulse is skipped during each access to external Data Memory.
If desired, ALE operation can be disabled by setting bit 0 of
SFR location 8 EH. With the bit se t, ALE is activ e only du ring a MOVX or MOVC instruction. Otherwise, the pin is
weakly pulled high. Setting the ALE-disable bit has no
effect if the microcontroller is in external execution mode.
PSEN
Program Store Enable is the read strobe to external program memory.
When the AT80F51 is executing code from external program memory, PSEN
is activated twice each machine
3-5
Page 4
cycle, except that two PSEN
each access to external data memory.
EA
External Access Enable. EA must be strapped to GND in
order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH.
Note, however, that if lock bit 1 is programmed, EA
internally latched on reset.
should be strapped to VCC for internal program execu-
EA
tions.
XTAL1
Input to the inverting os cillator ampl ifier and input to the
internal clock operating circuit.
XTAL2
Output from the inverting oscillator amplifier.
activations are skipped during
will be
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output, resp ectively,
of an inverting amplifier which can be configured for use as
an on-chip oscillator, as shown in Figure 1. 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 Figure 2.
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.
an unexpected write to a port pin when Idle is terminated by
reset, the instruction following the one that invokes Idle
should not be one th at writes to a p ort pin or to external
memory.
Figure 1.
Note:C1, C2 = 30 pF ± 10 pF for Cry s tals
Figure 2.
Oscillator Connections
C2
XTAL2
C1
XTAL1
GND
= 40 pF ± 10 pF for Ceramic Resonators
External Clock Drive Configuration
Idle Mode
In idle mode, the CPU puts itself to sleep while all the onchip peripherals remain active. The mode is invoked by
software. The content of the on-chip RAM and all the special functions registers remain unchanged during this
mode. The idle mode can be terminated by any en abled
interrupt or by a hardware reset.
It should be noted that when idle is terminated by a hard
ware reset, the devi ce normally r esumes prog ram execution, from where it le ft off, up t o tw o machi ne c ycles befo re
the internal reset algorithm takes control. On-chip hardware
inhibits access to internal RAM in this event, but access to
the port pins is not inhibited. To eliminate the possibility of
Power Down Mode
In the power down mode the oscillator is stopped, and the
instruction that in vokes po wer down is the last instruc tion
executed. The on-chip RAM and Special Function Registers retain their values until t he power do wn mode is ter mi-
Status of External Pins During Idle and Power Down Modes
ModeProgram MemoryALEPSENPORT0PORT1PORT2PORT3
IdleInternal11DataDataDataData
IdleExternal11FloatDataAddressData
Po w er Do wnInternal00DataDataDataData
Power DownExternal00FloatDataDataData
3-6
AT80F51
Page 5
AT80F51
nated. The only exit fr om power do wn is a hard ware reset .
Reset redefines the SFRs but does not change the on-c hip
RAM. The reset should not be activated before V
restored to its normal operating level and must be held
active long enough to allow the oscillator to restart and stabilize.
CC
When lock bit 1 is programmed, the logic level at the EA
is sampled and latched during reset. I f the dev ice is po w-
is
ered up without a reset, the latch initi alizes to a random
value, and holds that value until reset is activated. It is necessary that the latched value of EA
the current logic level at that pi n in order for the de vice to
function properly.
be in agreement with
Program Memory Lock Bits
On the chip are three lock bits which can be left unprogrammed (U) or can be programmed (P) to obtain the additional features listed in the table below:
Lock Bit Protection Modes
Program Lock BitsProtection Type
LB1LB2LB3
1UUUNo program lock features.
2PUUMOVC instructions executed from external program memory are disabled from fetching code
bytes from in ternal memory, EA
QuickFla sh is disabled.
3PPUSame as mode 2, also verify is disabled.
4PPPSame as mode 3, also external execution is disabled.
is sampled and la tched on reset, an d further progr amming of the
pin
Programming/Verifying the QuickFlash
The AT80F51 can only be p rogrammed by Atmel. Cus tomer codes should be submitted in
disk or uploaded to A tmel’s bu lleti n board or Web s ite. The
code should be in the Intel Hex format. The desired states
of the Lock Bits should be specified. Once programmed,
the code memory and Lock Bits cannot be erased or reprogrammed.
Please consult the factory or Atmel’s representatives for
details on submitting custom codes.
Program Verify:
programmed, the programmed code data can be read back
via the address and data lines for verific ation . The lock bits
If lock bits LB1 and LB2 have not been
duplicate
on a floppy
cannot be verified directly . Verification of the lock bits is
achieved by observing that their features are enabled.
Reading the Signature Bytes:
read by the same procedure as a normal verification of
locations 030H, 031H, and 032H, except that P3 .6 and
P3.7 must be pulled to a logic low. The values retur ned are
as follows.
Oscillator Frequency320MHz
Address to Data Valid48t
ENABLE Low to Data Valid48t
Data Float After ENABLE048t
QuickFlash Verification Waveforms
P1.0 - P1.7
P2.0 - P2.3
PORT 0
ALE
1
XTAL
GND
PSEN
VERIFICATION
ADDRESS
t
AVQV
DATA OUT
LOGIC 1
LOGIC 0
RST
V
IH
MinMaxUnits
CLCL
CLCL
CLCL
3-8
EA
P2.7
(ENABLE)
AT80F51
t
ELQV
LOGIC 1
LOGIC 0
t
EHQZ
Page 7
Absolute Maximum Ratings*
AT80F51
Operating Temperature..................................-55°C to +125°C
*NOTICE: Stresses beyond those listed under “Absolute
Maximum Ratings” may cause permanent dam-
Storage Temperature..................................... -65°C to +150°C
age to the dev ice . This is a s tress rating only an d
functional oper ation of the device at these o r any
Voltage on Any Pin
with Respect to Ground.....................................-1.0V to +7.0V
other conditions beyond those indicated in the
operational sections of this specification is not
implied. Exposure to absolute maximum rating
Maximum Operating Voltage.............................................6.6V
conditions f or e xtended periods ma y af fect de vice
reliability .
DC Output Current......................................................15.0 mA
DC Characteristics
TA = -40°C to 85°C, VCC = 5.0V ± 20% (unless otherwise noted)
SymbolParameterConditionMinMaxUnits
V
IL
V
IL1
V
IH
V
IH1
V
OL
V
OL1
V
OH
V
OH1
I
IL
I
TL
I
LI
RRSTReset Pulldown Resistor50300K
C
IO
I
CC
Notes: 1. Under steady state (non-transient) conditions, IOL must be external ly limited as follows:
2. Minimum V
Input Low Voltage(Except EA)-0.50.2 V
Input Low Voltage (EA)-0.50.2 V
Input High V oltage(Except XTAL1, RST)0.2 V
Input High Voltage(XTAL1, RST)0.7 V
Output Low Voltage
Output Low Voltage
(Port 0, ALE, PSEN)
Output High Voltage
(Ports 1,2,3, ALE, PSEN
Output High Voltage
(Port 0 in External Bus Mode)
Logical 0 Input Current (Ports 1,2,3)VIN = 0.45V -50
Logical 1 to 0 Transition Current
(Ports 1,2,3)
Input Leakage Current (Port 0, EA)0.45 < VIN < V
Pin CapacitanceTest Freq. = 1 MHz, TA = 25°C10pF
Power Supply CurrentActive Mode, 12 MHz20mA
Power Down Mode
Maximum I
Maximum I
per port pin: 10 mA
OL
per 8-bit port: Port 0: 26 mA
OL
(1)
(Ports 1,2,3)IOL = 1.6 mA0.45V
(1)
)
(2)
I
= 3.2 mA0.45V
OL
I
= -60 µA, VCC = 5V ± 10%2.4V
OH
I
= -25 µA0.75 V
OH
I
= -10 µA0.9 VCCV
OH
IOH = -800 µA, VCC = 5V ± 10%2.4V
I
= -300 µA0.75 V
OH
I
= -80 µA0.9 VCCV
OH
VIN = 2V, VCC = 5V ± 10%-650
CC
Idle Mode, 12 MHz5mA
VCC = 6V 100
V
= 3V 40
CC
+ 0.9V
CC
CC
CC
CC
- 0.1V
CC
- 0.3V
CC
+ 0.5V
CC
V
+ 0.5V
CC
±
10
Ports 1, 2, 3: 15 mA
Maximum total I
If I
exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater
OL
for all output pins: 71 mA
OL
than the listed test conditions.
for Power Down is 2V.
CC
V
V
µ
A
µ
A
µ
A
Ω
µ
A
µ
A
3-9
Page 8
AC Characteristics
(Under Operating Conditions; Load Capacitance for Port 0, ALE, and PSEN = 100 pF; Load Capacitance for all other outputs
= 80 pF)
Oscillator Frequency020MHz
ALE Pulse Width1272t
Address Valid to ALE Low43t
Address Hold After ALE Low48t
ALE Low to Valid Instruction In2334t
ALE Low to PSEN Low43t
PSEN Pulse Width2053t
PSEN Low to Valid Instruction In1453t
-40ns
CLCL
-13ns
CLCL
-20ns
CLCL
-65ns
CLCL
-13ns
CLCL
-20ns
CLCL
-45ns
CLCL
Input Instruction Hold After PSEN00ns
Input Instruction Float After PSEN59t
PSEN to Address Valid75t
-8ns
CLCL
Address to Valid Instruction In3125t
-10ns
CLCL
-55ns
CLCL
PSEN Low to Address Float1010ns
RD Pulse Width4006t
WR Pulse Width4006t
RD Low to Valid Data In2525t
-100ns
CLCL
-100ns
CLCL
-90ns
CLCL
Data Hold After RD00ns
Data Float After RD972t
ALE Low to Valid Data In5178t
Address to Valid Data In5859t
ALE Low to RD or WR Low2003003t
Address to RD or WR Low2034t
Data Valid to WR T ransition23t
Data Valid to WR High4337t
Data Hold After WR33t
-503t
CLCL
-75ns
CLCL
-20ns
CLCL
-120ns
CLCL
-20ns
CLCL
-28ns
CLCL
-150ns
CLCL
-165ns
CLCL
+50ns
CLCL
RD Low to Address Float00ns
RD or WR High to ALE High43123t
-20t
CLCL
+25ns
CLCL
3-10
AT80F51
Page 9
External Program Memory Read Cycle
t
LHLL
ALE
t
AVLL
t
LLPL
PSEN
t
LLAX
PORT 0
PORT 2
A0 - A7A0 - A7
t
AVIV
A8 - A15
External Data Memory Read Cycle
t
PLAZ
t
LLIV
t
PLIV
t
PXIZ
t
PXIX
INSTR IN
t
PLPH
t
PXAV
AT80F51
A8 - A15
ALE
PSEN
RD
PORT 0
PORT 2
t
LHLL
t
LLDV
t
LLWL
t
LLAX
t
AVLL
A0 - A7 FROM RI OR DPL
t
AVWL
P2.0 - P2.7 OR A8 - A15 FROM DPH
t
AVDV
t
RLAZ
t
WHLH
t
RLRH
t
RLDV
DATA ININSTR IN
t
RHDZ
t
RHDX
A0 - A7 FROM PCL
A8 - A15 FROM PCH
3-11
Page 10
External Data Memory Write Cycle
t
LHLL
ALE
PSEN
t
LLWL
t
WLWH
t
WHLH
WR
PORT 0
PORT 2
t
AVLL
A0 - A7 FROM RI OR DPL
P2.0 - P2.7 OR A8 - A15 FROM DPH
t
AVWL
t
LLAX
t
QVWX
External Clock Drive Waveforms
t
0.7 V
CC
CHCX
CC
0.45V
V - 0.5V
CC
0.2 V- 0.1V
t
t
QVWH
DATA OUTINSTR IN
t
CLCH
t
CLCX
WHQX
A0 - A7 FROM PCL
A8 - A15 FROM PCH
t
CHCX
t
CLCL
t
CHCL
External Clock Drive
SymbolParameterMinMaxUnits
1/t
t
CLCL
t
CHCX
t
CLCX
t
CLCH
t
CHCL
3-12
CLCL
Oscillator Frequency020MHz
Clock Period41.6ns
High Time15ns
Low Time15ns
Rise Time20ns
Fall Time20ns
AT80F51
Page 11
AT80F51
Serial Port Timing: Shift Register Mode Test Conditions
(VCC = 5.0 V ± 20%; Load Capacitance = 80 pF)
SymbolParameter12 MHz OscVariable OscillatorUnits
MinMaxMinMax
t
XLXL
t
QVXH
t
XHQX
t
XHDX
t
XHDV
Shift Register Mode Timing Waveforms
Serial Port Clock Cycle Time1.012t
Output Data Setup to Clock Rising Edge70010t
Output Data Hold After Clock Rising Edge502t
CLCL
-133ns
CLCL
-117ns
CLCL
Input Data Hold After Clock Rising Edge00ns
Clock Rising Edge to Input Data Valid70010t
-133ns
CLCL
s
µ
INSTRUCTION
WRITE TO SBUF
OUTPUT DATA
INPUT DATA
ALE
CLOCK
CLEAR RI
AC Testing Input/Output Waveforms
V - 0.5V
CC
0.45V
0
t
QVXH
0.2 V + 0.9V
CC
TEST POINTS
0.2 V - 0.1V
CC
1
t
XHDV
0
2
t
XLXL
t
XHQX
1
VALIDVALIDVALIDVALIDVALIDVALIDVALIDVALID
(1)
Note:1. AC Inputs during testing are driven at VCC - 0.5V for
a logic 1 and 0.45V for a logic 0. Timing measurements are made at V
min. for a logic 1 and VIL
IH
max. for a logic 0.
3
2
t
XHDX
Float Waveforms
V
LOAD
4
3
5
4
6
5
7
6
8
7
SET TI
SET RI
(1)
V
V
LOAD
LOAD
+ 0.1V
- 0.1V
Timing Reference
Points
- 0.1V
V
OL
+ 0.1V
V
OL
Note:1. For timing purposes, a port pin is no longer floating
when a 100 mV change fro m load voltage occurs . A
port pin begins to float when 100 mV change from
the loaded V