M68HC11
REFERENCE MANUAL
PARALLEL INPUT/OUTPUT
MOTOROLA
7-1
SECTION 7
PARALLEL INPUT/OUTPUT
This section describes parallel I/O operations in the MC68HC11A8, which includes
port reads and writes as well as strobe and handshake operations on ports B and C.
The section begins with an overview, followed by detailed descriptions of each port
and the handshake I/O subsystem. A number of schemes for efficient use of parallel
I/O on the MC68HC11A8 are included.
7.1 Parallel I/O Overview
The MC68HC11A8 has a total of 40 I/O pins, which will be discussed in
7.3 Detailed
I/O Pin Descriptions
. All these pins are shared between general-purpose I/O usage
and at least one other on-chip peripheral function. Although the following paragraphs
are primarily concerned with the general-purpose I/O capabilities of these pins, some
important interactions with the alternate functions will be discussed.
Shared functions of port A include general-purpose I/O, the main timer system, and
the pulse accumulator system. Port A has three fixed-direction input pins, four fixed-
direction output pins, and one bidirectional pin. The direction of the PA7 pin is con-
trolled by the data direction register A bit 7 control bit (DDRA7) in the pulse accumu-
lator control (PACTL) register. Port A data is read from and written to the PORTA
register. Meaningful data may be read from port A even when the pins are configured
for an alternate timer or pulse accumulator function. Data written to port A does not
directly affect port A pins configured for an alternate timer output function, but the data
is remembered in an internal latch so that, if the alternate function is disabled later, the
last data written to port A will be driven out of the associated output pin.
Ports B and C and the strobe A (STRA) and strobe B (STRB) pins should be consid-
ered together because their function depends on the basic operating mode of the
MC68HC11A8. When the microcontroller unit (MCU) is operating in a single-chip
mode, these 18 pins are used for general-purpose I/O and for the handshake I/O sub-
system. When the MCU is operating in an expanded mode, these pins are used for a
multiplexed address/data bus. The handshake and general-purpose I/O functions,
which are lost in the expanded mode, can be regained by use of the MC68HC24 port
replacement unit. Special care was taken in designing both these parts so that soft-
ware could be developed on an expanded system using these two parts and then later
be mask programmed into the read-only memory (ROM) of an MC68HC11A8, which
will be used in single-chip mode. Although care was taken to assure that the expanded
system with an MC68HC24 would work exactly like the MC68HC11A8 in single-chip
mode, there are a few subtle differences. For the vast majority of applications, these
differences are irrelevant. For the benefit of those rare cases where a problem could
arise, the differences will be explained in the detailed descriptions of these ports and
pins in
7.3 Detailed I/O Pin Descriptions
.