
MOTOROLA
8-6
SYNCHRONOUS SERIAL PERIPHERAL INTERFACE
M68HC11
REFERENCE MANUAL
drain drivers. The port D wired-OR mode (DWOM) control bit is used to enable this
option. An external pull-up resistor is required on each port D output pin while this op-
tion is selected. In multiple-master systems, this option provides extra protection
against CMOS latchup because, even if more than one SPI device tries to simulta-
neously drive the same bus line, there will be no destructive contention. Other unusual
SPI system configurations also benefit from this option (e.g., when MISO and MOSI
are tied together to form a single, bidirectional data line).
8.4 SPI Registers
The SPI control register (SPCR), SPI status register (SPSR), and SPDR are software-
accessible registers used to configure and operate the SPI system. Because the port
D data direction control register (DDRD) influences SPI activities, it will be discussed
briefly. Detailed logic diagrams of the port D pins can be found in
SECTION 7 PAR-
ALLEL INPUT/OUTPUT
.
8.4.1 Port D Data Direction Control Register (DDRD)
This register, which may be read or written at any time, is used to control the primary
direction of port D pins. Bits 5, 4, 3, and 2 of port D are used by the SPI system when
the SPI enable (SPE) control bit is one. The serial communications interface (SCI) sys-
tem uses the other two bits of port D when the SCI receiver and transmitter are en-
abled. This description of DDRD is only intended to cover material related to the SPI
system.
DDRD5 — Data Direction Control for Port D Bit 5 (SS)
When the SPI system is enabled as a slave (SPE = 1; MSTR = 0), the PD5/SS pin is
the slave select input, regardless of the value of DDRD5. When the SPI system is en-
abled as a master (SPE = 1; MSTR = 1), the function of the PD5/SS pin depends on
the value in DDRD5.
0 = The SS pin is used as an input to detect mode-fault errors. A low on this pin
indicates that some other device in a multiple-master system has become a
master and is trying to select this MCU as a slave. To prevent harmful conten-
tions between output drivers, a mode fault is generated, which causes the de-
vice sensing the fault to immediately change all of its SPI pins to high
impedance. Additional information on mode faults is given in
8.5.1 SPI Mode-
Fault Error
.
1 = The PD5/SS pin acts as a general-purpose output not affected by the SPI sys-
tem. Because the mode-fault detection logic in the SPI is disabled, changing
this PD5 output pin to zero does not affect the SPI system.
DDRD4 — Data Direction Control for Port D Bit 4 (SCK)
DDRD —
Port D Data Direction Register
$1009
BIT 7
—
0
6
—
0
5
4
3
2
1
BIT 0
DDRD0
0
DDRD5
0
DDRD4
0
DDRD3
0
DDRD2
0
DDRD1
0
RESET:
REFER-
ENCE:
—
—
TS
SCK
MOSI
MISO
TxD
RxD