
SERIAL PERIPHERAL INTERFACE
8-6
When the SPE bit is set the Port D bit 2, 3, 4, and 5 pins are dedicated to the SPI function.
If the SPI is in master mode and DDRD bit 5 is set, then the Port D bit 5 pin becomes a
general purpose output instead of the SS input.
DWOM — Port D Wired-OR Mode
0 – Port D output buffers operate normally (CMOS outputs).
1 – Port D output buffers operate as open-drain outputs.
DWOM affects all six Port D pins together.
MSTR — Master/Slave Mode Select
0 – Slave mode.
1 – Master mode.
CPOL — Clock Polarity
When the clock polarity bit is cleared and data is not being transferred, a steady state low
value is produced at the SCK pin of the master device. Conversely, if this bit is set,
the SCK pin will idle high. This bit is also used in conjunction with the clock phase
control bit to produce the desired clock-data relationship between master and slave. See
Figure 8-1.
CPHA — Clock Phase
The clock phase bit, in conjunction with the CPOL bit, controls the clock-data relationship
between master and slave. The CPOL bit can be thought of simply as inserting an inverter
in series with the SCK line. The CPHA bit selects one of two fundamentally different
clocking protocols. When CPHA = 0, the shift clock is the logical OR of SCK and SS. As
soon as SS goes low, the transaction begins and the first edge on SCK invokes the first
data sample. When CPHA = 1, the SS pin may be thought of as a simple output enable
control. Refer to Figure 8-1.
SPR1, SPR0 — SPI Clock (SCK) Rate Select Bits
If the device is a master, the two serial peripheral rate bits select one of four division ratios
of the E-clock to be used as SCK (see Table 8-1). These bits have no effect in slave mode.
Table 8-1. SPI Rate Selection
Internal Processor
Clock Divide By
SPR1
SPR0
00
2
01
4
10
16
11
32
Freescale
Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc.
..
Because
of
an
order
from
the
United
States
International
Trade
Commission,
BGA-packaged
product
lines
and
part
numbers
indicated
here
currently
are
not
available
from
Freescale
for
import
or
sale
in
the
United
States
prior
to
September
2010:
MC68HC11G5,
MC68HC11G7,
MC68HC711G5