Not
3
The AT87F51 provides the following standard features: 4K
bytes of QuickFlash, 128 bytes of RAM, 32 I/O lines, two
16-bit tim er/count ers, a five v ector tw o-level interrup t archi-
tecture, a full duplex serial port, on-chip oscillator and clock
circuitry. In addition, the AT87F 51 is designed with static
logic for operation down to z ero frequency an d supports
two software selectable power saving modes. The Idle
Mode stops the CPU while allowing the RAM,
timer/counters, serial port and interrupt system to continue
func tioning. The Pow er Down M ode save s the RAM c on-
tents bu t freezes the osci llato r disablin g all othe r chi p func-
tions until the next hardware reset.
Pin Description
VCC
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 T TL inputs. When 1s
are written to port 0 pins, the pins can be used as high-
impedance inputs.
Port 0 may also be configured to be the multiplexed low-
order address/data bus during accesses to external pro-
gram and data memo ry. In th is mode P0 has internal pul -
lups.
Port 0 a lso rece ives the code bytes du ring Qui ckFl ash pr o-
grammin g, an d outp uts the c ode byt es d uring pro gram ver-
ificati on. Ex te rnal pullu ps a re r equ ired during pro gr am ve ri -
fication.
Port 1
Port 1 is a n 8- bit bi dire ction al I/O por t with inter nal pullu ps.
The Port 1 output buffers can sink/sou rce four T TL inputs.
When 1s are written to Port 1 pins they are pulled high by
the internal pullups and can be us ed as inputs. As i nputs,
Port 1 pins that are externally being pulled low will source
current (IIL) because of the internal pullups.
Port 1 also receives the low-order address bytes during
QuickFlash programming and verification.
Port 2
Port 2 is a n 8- bit bi dire ction al I/O por t with inter nal pullu ps.
The Port 2 output buffers can sink/sou rce four T TL inputs.
When 1s are written to Port 2 pins they are pulled high by
the internal pullups and can be us ed as inputs. As i nputs,
Port 2 pins that are externally being pulled low will source
current (IIL) because of the internal pullups.
Port 2 emits the high-order address byte during fetches
from external program memory and during accesses to
externa l data memory that us e 16 -b it addre ss es ( MO VX @
DPTR). In this appli cation it uses strong in ternal pullups
when emitting 1s. During accesses to ex ternal data mem-
ory that use 8-bit addresses (MOVX @ RI), Port 2 emits the
contents of the P2 Special Function Register.
Port 2 also r eceives the high-order address bits and some
control signals during QuickFlash programming and verifi-
cation.
Port 3
Port 3 is an 8-b it bidirectiona l I/O port with in ternal pullup s.
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 pul lups and can be us ed as inputs. As i nputs,
Port 3 pins that are externally being pulled low will s ource
current (IIL) because of the pullups.
Port 3 also serves the funct ions of var ious s peci al featu res
of the AT87F51 as listed below:
Port 3 also receives some control signals for QuickFlash
programming and verification.
RST
Reset input. A high on this pin for two machine cycles while
the oscill ator is runni ng re se ts the dev ic e.
ALE/PROG
Address Latch Enable output pulse for latching the low byte
of the address during accesses to external me mory. This
pin is als o the program puls e input (PROG) during Quick-
Flash programming.
In normal operation ALE is emitted at a constant rate of 1/6
the osc illator frequ ency, an d may be used for ex terna l tim-
ing or clocking purposes. Note, however, that one ALE
pulse is skipped during each access to external Data Mem-
ory.
If desired, ALE operation can be disabled by setting bit 0 of
SFR loc atio n 8EH. Wi th the b it set, A LE is a ctive o nly dur-
ing 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 pro-
gram memory.
Port Pin Alternate Functions
P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data mem ory write strobe)
P3.7 RD (external data memory read strobe)