Specifications
49
3706C–MICRO–2/11
AT89LP3240/6440
10.4 Port Alternate Functions
Most general-purpose digital I/O pins of the AT89LP3240/6440 share functionality with the vari-
ous 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,
otherwisethe input/ou
tput will always be “0”. However, alterna te 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 b e 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 configu re a generic pin for
use with an alternate f
unction.
Table 10-5. Alternate Function Configurations for Pin y of Port x
PxM0.y PxM1.y Px.y I/O Mode
00 1bidirectional (internal pull-up)
01 1output
10Xinput
11 1bidirectional (external pull-up)
Table 10-6. Port Pin Alternate Functions
Port Pin
Configuration Bits
Alternate
Function NotesPxM0.y PxM1.y
P0.0 P0M0.0 P0M1.0
AD0 Automatic configuration
ADC0 input-only
P0.1 P0M0.1 P0M1.1
AD1 Automatic configuration
ADC1 input-only
P0.2 P0M0.2 P0M1.2
AD2 Automatic configuration
ADC2 input-only
P0.3 P0M0.3 P0M1.3
AD3 Automatic configuration
ADC3 input-only
P0.4 P0M0.4 P0M1.4
AD4 Automatic configuration
ADC4 input-only
P0.5 P0M0.5 P0M1.5
AD5 Automatic configuration
ADC5 input-only
P0.6 P0M0.6 P0M1.6
AD6 Automatic configuration
ADC6 input-only
P0.7 P0M0.7 P0M1.7
AD7 Automa
tic configuration
ADC7 input-only
P1.0 P1M0.0 P1M1.0
T2
GPI0
P1.1 P1M0.1 P1M1.1
T2EX
GPI1