M68HC11
REFERENCE MANUAL
PARALLEL INPUT/OUTPUT
MOTOROLA
7-29
This pin alternately serves as the transmit data (TxD) output pin for the asynchronous
SCI system. The SCI transmitter is enabled by the TE control bit in an SCI control reg-
ister. Enabling the transmitter forces the pin driver to be configured as an output by
forcing a one at the output of OR gate [3]. The state of the DDRD bit allows the pro-
grammer to read the TxD pin (DDRD = 0) or the value in port D latch [8] (when DDRD
equals one). The SCI transmitter retains control of the port D pin by keeping XMITON
equal to one as long as any information is being transmitted (even after the TE bit is
written to zero). This control assures that a transmission will not be cut off in the middle
of a serial character.
The user can control what happens to the TxD pin when the transmitter is finished.
When the transmitter is finished using the TxD pin, the XMITON signal switches from
one to zero, which causes the data direction to be controlled by the DDRD bit from
HFF [1] instead of the XMITON input to OR gate [3]. Disabling XMITON also causes
transmission gate [10] to be disabled and transmission gate [11] to be enabled. If the
corresponding DDRD bit is zero, the pin will revert to being a high-impedance input
when the transmitter is finished. If the DDRD bit is one and the last data written to the
corresponding bit of port D was a zero, the pin will revert to a driven logic zero when
the transmitter is finished. If the DDRD bit is one and the last data written to the corre-
sponding bit of port D was a one, the pin will revert to a driven logic one when the trans-
mitter is finished.
7.3.6.3 PD2 (MISO) Pin Logic
This pin alternately functions as the MISO pin when the synchronous SPI system is
enabled. Refer to
Figure 7-18
for the following discussion. The data direction specifi-
cation for this pin is held in HFF [1], During a write to the DDRD register, the WDDRD
signal is asserted, which causes data to be transferred into HFF [1] from the internal
data bus. A read of DDRD causes the RDDRD signal to be asserted, enabling trans-
mission 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 an SPI mode fault (MFAULT) occurs. An SPI mode fault is
caused when a device configured as a master SPI device is selected as if it were a
slave. This condition 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-
tion. When the SPI system is enabled in master mode, this pin is forced to a high-im-
pedance input. When the SPI system is enabled in slave mode, the DDRD bit from
HFF [1] controls direction. This last condition means that the user must set the corre-
sponding DDRD bit to one to enable slave data output from this pin when the SPI sys-
tem is enabled for slave operation. The uses and implications of this logic are
discussed in greater detail in
SECTION 8 SYNCHRONOUS SERIAL PERIPHERAL
INTERFACE
.