English
Language : 

AT89LP52_14 Datasheet, PDF (45/117 Pages) ATMEL Corporation – 8-bit Microcontroller Compatible with 8051 Products
AT89LP51/52
10.3
Port Alternate Functions
Most general-purpose digital I/O pins of the AT89LP51/52 share functionality with the various
I/Os needed for the peripheral units. Table 10-6 lists the alternate functions of the port pins.
Alternate functions are connected to the pins in a logic AND fashion. In order to enable the
alternate function on a port pin, that pin must have a “1” in its corresponding port register bit,
otherwise the input/output will always be “0”. However, alternate functions may be temporarily
forced to “0” by clearing the associated port bit, provided that the pin is not in input-only mode.
Furthermore, each pin must be configured for the correct input/output mode as required by its
peripheral before it may be used as such. Table 10-5 shows how to configure a generic pin for
use with an alternate function. If two or more port pins on the same 8-bit require difference direc-
tions, the port must be configured for bidirectional operation.
Table 10-5. Pin Function Configurations for Port x Pin y
PxM0
PxM1
Px.y
0
0
1
0
1
1
1
0
X
1
1
1
I/O Mode
bidirectional (internal pull-up)
output
input
bidirectional (external pull-up)
Table 10-6.
Port Pin
Port Pin Alternate Functions
Configuration Bits
PxM0
PxM1
P0.0–P0.7
N/A
P1.0
P1.1
P1.5
P1.6
P1.7
P2.0–P2.7
P3.0
P3.1
P3.2
P3.3
P3.4
P3.5
P3.6
P3.7
P1M0
P1M0
P1M0
P1M0
P1M0
P1M1
P1M1
P1M1
P1M1
P1M1
N/A
P3M0
P3M0
P3M0
P3M0
P3M0
P3M0
P3M0
P3M0
P3M1
P3M1
P3M1
P3M1
P3M1
P3M1
P3M1
P3M1
Alternate
Function
AD0–AD7
T2
T2EX
MOSI
MISO
SCK
A8–A15
RXD
TXD
INT0
INT1
T0
T1
WR
RD
Notes
Address and data on Port 0 are
automatically configured as output
or input regardless of P0M0 and
P0M1.
T2 Clock out toggles P1.0 directly
Address on Port 2 is automatically
configured as output regardless of
P2M0 and P2M1.
T0 Clock out toggles P3.4 directly
T1 Clock out toggles P3.5 directly
45
3709D–MICRO–12/11