M68HC11
REFERENCE MANUAL
PARALLEL INPUT/OUTPUT
MOTOROLA
7-37
bit from HFF [1] can enable or disable driver [9]. When the SPI system is enabled as
a slave, SPE is one, and the master/slave control bit (MSTR) is zero. This configura-
tion causes NAND gate [10] to output zero, which disables output driver [9], regardless
of the state of the DDRD bit at HFF [1]. When the SPI system is enabled as a master,
SPE is one and MSTR is one. This causes NAND gate [10] to output one, which en-
ables NAND gate [3] to control the direction of output buffer [9] based on the state 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 a high-impedance input. An external pull-up is used to pas-
sively pull the pin high. The data for output driver [9] comes from the output of HFF [8].
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 slave enable signal to the SPI logic is developed by NOR gate [11]. The active-
low SS signal from the pin is buffered by inverters [7] and drives one input of NOR gate
[11]. The other two inputs to this NOR gate act as enables, and the output of the NOR
gate is an active-high slave select signal to the main SPI logic. When the SPI system
is disabled, SPE is zero, disabling NOR gate [11] by forcing its output to zero. When
pin output driver [9] is enabled by a zero at the output of NAND gate [3], NOR gate [11]
is also disabled by the output of inverter [12]. This disabled condition corresponds to
SPI being enabled as a master and the DDRD bit associated with the SS pin being set
to one. In this case, the PD5 pin is being used as a general-purpose output and has
nothing to do with the SPI system. To avoid an erroneous mode fault condition due to
a zero at this pin, the SS signal is disabled to the SPI logic.
7.3.6.7 Idealized Port D Timing
Figure 7-22
shows the idealized timing for important port D control signals. Since this
timing diagram does not consider any propagation delays, it cannot be used as a sub-
stitute for data-sheet timing specifications. This information is useful for understanding
the basis for data-sheet timing specifications so timing information can be extrapolated
for bus frequencies other than that used for the data sheet. Timing information con-
cerning the SPI system is included in
SECTION 8 SYNCHRONOUS SERIAL PE-
RIPHERAL INTERFACE
.