M68HC11
REFERENCE MANUAL
PARALLEL INPUT/OUTPUT
MOTOROLA
7-33
of the DDRD bit from HFF [1].
Output driver [9] can be placed in a wired-OR configuration by the DWOM control bit.
This control bit simultaneously affects all six port D pins. When DWOM is one, the P-
channel device in the output driver is disabled so the pin cannot be actively driven
high. When the pin attempts to output logic one, the N-channel device is disabled;
thus, the pin appears as high-impedance input. An external pull-up is used to passively
pull the pin high.
The data for output driver [9] comes from transmission gate [10] or [11]. When the SPI
system is enabled, the SPE bit is one; transmission gate [10] is enabled, and data for
the output driver comes from the SPI master data output signal (MSTRDO). When the
SPI system is disabled, the SPE control bit is zero; transmission gate [10] is disabled
and transmission gate [11] is enabled. In this case, port D data is coupled from the out-
put of HFF [8] to the input of output driver [9]. During a write to port D, the WPORTD
signal is asserted, which causes data to be latched into HFF [8] from the internal data
bus.
During a read of port D, transmission gate [6] is enabled by the RPORTD signal to cou-
ple data to the internal data bus. The source of data for port D reads depends on the
direction control for the output driver. If the output of NAND gate [3] is zero, output driv-
er [9] is enabled and transmission gate [4] is enabled. In this case, port D reads return
the data from a point inside the output driver. If the output of NAND gate [3] is one,
transmission gate [5] is enabled. In this case, reads of port D return the buffered state
from the pin through inverters [7].
The output of inverters [7] drives the serial slave data input to the SPI system logic.
Because the source of this data is always from the MOSI pin, it is not affected by the
data direction logic.
7.3.6.5 PD4 (SCK) Pin Logic
This pin alternately functions as the SPI SCK output pin when the synchronous SPI
system is enabled. Refer to
Figure 7-20
for the following discussion. The data direc-
tion specification for this pin is held in HFF [1]. During a write to the DDRD register,
the WDDRD signal is asserted, causing data to be transferred into HFF [1] from the
internal data bus. A read of DDRD causes the RDDRD signal to be asserted, which
enables transmission gate [2] to couple the output of HFF [1] onto the internal data
bus.
When HFF [1] is cleared to zero, this pin is configured as a high-impedance input. OR
gate [13] causes HFF [1] to be cleared to zero during reset. OR gate [13] also causes
HFF [1] to be cleared if there is an SPI mode fault. An SPI mode fault is caused when
a device configured as a master SPI device is selected as if it were a slave. This con-
dition could indicate that more than one SPI device is attempting to drive the common
SPI lines, which could cause a bus conflict. To avoid the possibility of latchup, the port
D pins associated with the SPI are immediately forced to their input configuration.
The actual data direction for this port D pin is determined by the logic output of NAND
gate [3]. When the SPI system is disabled, the DDRD bit from HFF [1] controls direc-