4 port alternate functions – Rainbow Electronics AT89LP216 User Manual
Page 26
![background image](/manuals/281824/26/background.png)
26
3621A–MICRO–6/06
AT89LP216 [Preliminary]
13.4
Port Alternate Functions
Most general-purpose digital I/O pins of the AT89LP216 share functionality with the various I/Os
needed for the peripheral units.
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”. Furthermore, each pin must be configured
for the correct input/output mode as required by its peripheral before it may be used as such.
shows how to configure a generic pin for use with an alternate function.
Table 13-4.
Alternate Function Configurations for Pin y of Port x
PxM0.y
PxM1.y
Px.y
I/O Mode
0
0
1
bidirectional (internal pull-up)
0
1
1
output
1
0
X
input
1
1
1
bidirectional (external pull-up)
Table 13-5.
Port Pin Alternate Functions
Port Pin
Configuration Bits
Alternate
Function
Notes
PxM0.y
PxM1.y
P1.0
P1M0.0
P1M1.0
AIN0
input-only
GPI0
P1.1
P1M0.1
P1M1.1
AIN1
input-only
GPI1
P1.2
P1M0.2
P1M1.2
GPI2
P1.3
P1M0.3
P1M1.3
GPI3
RST must be disabled
P1.4
P1M0.4
P1M1.4
SS
GPI4
P1.5
P1M0.5
P1M1.5
MOSI
GPI5
P1.6
P1M0.6
P1M1.6
MISO
GPI6
P1.7
P1M0.7
P1M1.7
SCK
GPI7
P3.0
P3M0.0
P3M1.0
RXD
P3.1
P3M0.1
P3M1.1
TXD
P3.2
P3M0.2
P3M1.2
INT0
Internal RC Oscillator Only
P3.3
P3M0.3
P3M1.3
INT1
Internal RC Oscillator or
External Clock Source Only
CLKOUT
P3.4
P3M0.4
P3M1.4
T0
P3.5
P3M0.5
P3M1.5
T1
P3.6
not configurable
CMPOUT
Pin is tied to comparator output