
M68HC11
REFERENCE MANUAL
SYNCHRONOUS SERIAL PERIPHERAL INTERFACE
MOTOROLA
8-7
When the SPI system is enabled as a slave, the PD4/SCK pin acts as the SPI serial
clock input, regardless of the state of DDRD4. When the SPI system is enabled as a
master, the DDRD4 bit must be set to one to enable the SCK output.
DDRD3 — Data Direction Control for Port D Bit 3 (MOSI)
When the SPI system is enabled as a slave, the PD3/MOSI pin acts as the slave serial
data input, regardless of the state of DDRD3.
When the SPI system is enabled as a master, the DDRD3 bit must be set to one to
enable the master serial data output. If a master device wants to initiate an SPI transfer
to receive a byte of data from a slave without transmitting a byte, it might purposely
leave the MOSI output disabled. SPI systems that tie MOSI and MISO together to form
a single bidirectional data line also need to selectively disable the MOSI output.
DDRD2 — Data Direction Control for Port D Bit 2 (MISO)
When the SPI system is enabled as a slave, the DDRD2 bit must be set to one to en-
able the slave serial data output. A master SPI device can simultaneously broadcast
a message to several slaves as long as no more than one of the slaves tries to drive
the MISO line. SPI systems that tie MOSI and MISO together to form a single bidirec-
tional data line also need to selectively disable the MISO output.
When the SPI system is enabled as a master, the PD2/MISO pin acts as the master
serial data input, regardless of the state of DDRD2.
8.4.2 SPI Control Register (SPCR)
This register, which may be read or written at any time, is used to configure the SPI
system. The DDRD register must also be properly configured before SPI transfers can
occur.
SPIE — SPI Interrupt Enable
0 = SPI interrupts are disabled. Polling is used to sense the SPIF and MODF flags.
1 = SPI interrupt is requested if SPIF or MODF set (provided I bit in condition code
register (CCR) is zero).
SPE — SPI System Enable
0 = SPI system is off.
1 = SPI system is on.
DWOM — Port D Wired-OR Mode Select
0 = Port D outputs are push-pull.
1 = P-channel pull-ups on all six port D output drivers are disabled so port D outputs
act as open-drain drivers.
MSTR — Master/Slave Mode Select
0 = SPI is configured as a slave.
SPCR —
SPI Control Register
$1028
BIT 7
SPIE
0
6
5
4
3
2
1
BIT 0
SPR0
U
SPE
0
DWOM
0
MSTR
0
CPOL
0
CPHA
1
SPR1
U
RESET: