Datasheet

PortsA&B
The highly flexible A and B ports are similarly structured.
The Port A (see
Figure 11
), consists of a data register and a
direction register. Port B (see
Figures 12, 13, 14
) has an
alternate function register in addition to the data and direc-
tion registers. All the control registers are read/write regis-
ters.
The associated direction registers allow the port pins to be
individually programmed as inputs or outputs. Port pins se-
lected as inputs, are placed in a TRI-STATE mode by reset-
ting corresponding bits in the direction register.
A write operation to a port pin configured as an input causes
the value to be written into the data register, a read opera-
tion returns the value of the pin. Writing to port pins config-
ured as outputs causes the pins to have the same value,
reading the pins returns the value of the data register.
Primary and secondary functions are multiplexed onto Port
B through the alternate function register (BFUN). The sec-
ondary functions are enabled by setting the corresponding
bits in the BFUN register.
TL/DD/880113
FIGURE 11. Port A: I/O Structure
TL/DD/880114
FIGURE 12. Structure of Port B Pins B0, B1, B2, B5, B6 and B7 (Typical Pins)
14