Bidirectional Port Operation - Intel 8XC196K Series User Manual

Table of Contents

Advertisement

8XC196K x , J x , CA USER'S MANUAL
Table 6-5. Bidirectional Port Control and Status Registers (Continued)
Mnemonic
Address
P1_MODE
1FD0H
P2_MODE
1FC9H
P5_MODE
1FF1H
P6_MODE
1FD1H
P1_PIN
1FD6H
P2_PIN
1FCFH
P5_PIN
1FF7H
P6_PIN
1FD7H
P1_REG
1FD4H
P2_REG
1FCDH
P5_REG
1FF5H
P6_REG
1FD5H
6.3.1

Bidirectional Port Operation

Figure 6-2 shows the logic for driving the output transistors, Q1 and Q2. Q1 can source at least
–3 mA at V
– 0.7 volts. Q2 can sink at least 3 mA at 0.45 volts. (Consult the datasheet for spec-
CC
ifications.)
In I/O mode (selected by clearing Px_MODE.y), Px_REG and Px_DIR are input to the multiplex-
ers. These signals combine to drive the gates of Q1 and Q2 so that the output is high, low, or high
impedance. Table 6-6 is a logic table for I/O operation of these ports.
In special-function mode (selected by setting Px_MODE.y), SFDIR and SFDATA are input to the
multiplexers. These signals combine to drive the gates of Q1 and Q2 so that the output is high,
low, or high impedance. Special-function output signals clear SFDIR; special-function input sig-
nals set SFDIR. Table 6-7 is a logic table for special-function operation of these ports. Even if a
pin is to be used in special-function mode, you must still initialize the pin as an input or output
by writing to Px_DIR.
6-6
Port x Mode
Each bit of P x _MODE controls whether the corresponding pin
functions as a standard I/O port pin or as a special-function signal.
0 = standard I/O port pin
1 = special-function signal
Port x Input
Each bit of P x _PIN reflects the current state of the corresponding
pin, regardless of the pin configuration.
Port x Data Output
For an input, set the corresponding P x _REG bit.
For an output, write the data to be driven out by each pin to the
corresponding bit of P x _REG. When a pin is configured as standard
I/O (P x _MODE. x =0), the result of a CPU write to P x _REG is
immediately visible on the pin. When a pin is configured as a
special-function signal (P x _MODE. x =1), the associated on-chip
peripheral or off-chip component controls the pin. The CPU can still
write to P x _REG, but the pin is unaffected until it is switched back to
its standard I/O function.
This feature allows software to configure a pin as standard I/O (clear
P x _MODE. x ), initialize or overwrite the pin value, then configure the
pin as a special-function signal (set P x _MODE. x ). In this way, initial-
ization, fault recovery, exception handling, etc., can be done without
changing the operation of the associated peripheral.
Description

Advertisement

Table of Contents
loading

Table of Contents