MC68HC11A8
TECHNICAL DATA
SERIAL PERIPHERAL INTERFACE
MOTOROLA
6-5
6
MSTR — Master 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 con-
trol bit to produce the desired clock-data relationship between master and slave. See
Figure 6-1
.
CPHA — Clock Phase
The clock phase bit, in conjunction with the CPOL bit, controls the clock-data relation-
ship between master and slave. The CPOL bit can be thought of as simply 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 OR of SCK with 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 6-1
.
SPR1 and SPR0—SPI Clock Rate Selects
These two serial peripheral rate bits select one of four baud rates (
Table 6-1
) to be
used as SCK if the device is a master; however, they have no effect in the slave mode.
6.4.2 Serial Peripheral Status Register (SPSR)
SPIF — SPI Transfer Complete Flag
The serial peripheral data transfer flag bit is set upon completion of data transfer be-
tween the processor and external device. If SPIF goes high, and if SPIE is set, a serial
peripheral interrupt is generated. Clearing the SPIF bit is accomplished by reading the
SPSR (with SPIF set) followed by an access of the SPDR. Unless SPSR is read (with
SPIF set) first, attempts to write to SPDR are inhibited.
Table 6-1 Serial Peripheral Rate Selection
SPR1
SPR0
Internal Processor,
Clock Divide By
2
4
16
32
0
0
1
1
0
1
0
1
7
6
5
0
0
4
3
0
0
2
0
0
1
0
0
0
0
0
$
1
029
RESET
SPIF
0
WCOL
0
MODF
0
SPSR