MOTOROLA
7-2
PARALLEL INPUT/OUTPUT
M68HC11
REFERENCE MANUAL
Port B is a general-purpose, 8-bit, fixed-direction output port. Writes to the port B reg-
ister (PORTB) cause data to be latched and driven out of the port B pins. Reads of
PORTB return the last data that was written to port B. When the handshake I/O sub-
system is operating in simple strobed mode, writes to PORTB automatically cause a
pulse on the STRB output pin. The simple strobe mode is selected by the handshake
(HNDS) control bit equal to zero in the parallel I/O control (PIOC) register.
Port C is a general-purpose, 8-bit, bidirectional I/O port. The primary direction of data
flow at each port C pin is independently controlled by a corresponding bit in the data
direction control register for port C (DDRC). In addition to normal I/O functions at port
C, there is an independent, 8-bit, parallel latch that captures port C data whenever a
selected active edge is detected on the STRA input pin. Reads of PORTCL return the
contents of this port C latch; whereas, reads of PORTC return the current data from
port C. Writes to either PORTC or PORTCL cause the written data to be driven out of
port C output pins; however, PORTCL writes also trigger output handshake sequenc-
es; PORTC writes do not. Writes to port C pins not configured as outputs do not cause
data to be driven out of those pins, but the data is remembered in internal latches;
thus, if the pins later become outputs, the last data written to PORTC or PORTCL will
be driven out the port C pins.
Port C can be configured for wired-OR operation by setting the port C wired-OR mode
(CWOM) control bit in the PIOC register. This procedure disables the P-channel pull-
up drivers of port C output pins and allows port C pins to be directly connected to each
other or to other open-drain-type pins. In this configuration, there is no danger of de-
structive conflicts if two output drivers try to drive the same node at the same time. As
with any open-drain line, an external pull-up resistor is required.
Whenever the handshake I/O subsystem is configured for a full-handshake mode, port
C is used for parallel data input or output. STRA is a strobe input pin that causes port
C data to be captured when a selected edge is detected. In the three-state variation of
full-output handshake, the STRA pin also acts as an output enable control to force port
C pins to be driven outputs while STRA is in its selected state. STRB is a strobe output
pin that can be used in a pulsed or interlocked configuration. In the pulsed configura-
tion, some action in the handshake I/O subsystem initiates STRB, which then stays
active for two E-clock cycles before reverting to its inactive state. In the interlocked
configuration, STRB is initiated by one action in the handshake subsystem and termi-
nated by a separate action. The final major element of the handshake subsystem is
the strobe A flag (STAF) status bit. STAF is always set upon recognition of the select-
ed edge at the STRA pin, but the action that clears STAF depends on the handshake
mode. There is a more detailed description of the handshake I/O subsystem in
7.4
Handshake I/O Subsystem
.
Port D is a general-purpose, 6-bit, bidirectional data port. Two port D pins are alter-
nately used by the asynchronous serial communications interface (SCI) subsystem.
The remaining four port D pins are alternately used by the synchronous serial periph-
eral interface (SPI) subsystem. The primary direction of data flow at each of the port
D pins is selected by a corresponding bit in the data direction register for port D
(DDRD). Port D can be configured for wired-OR operation by setting the port D wired-