
SERIAL PERIPHERAL INTERFACE
8-7
8.4.2
Status Register (SPSR)
SPSR
$1029
7
6
5
4
3
2
1
0
RESET:
SPIF
WCOL
0
MODF
0
READ:
Any time.
WRITE:
Has no meaning or effect.
SPIF — SPI Interrupt Request Flag
The serial peripheral data transfer flag bit is set after the eighth SCK cycle in a data
transfer and it is cleared by reading the SPSR register (with SPIF set) followed by reading
from or writing to the SPI Data Register (SPDAT).
WCOL — Write Collision
The write collision bit is used to indicate that a serial transfer was in progress when the
MCU tried to write new data into the SPDAT data register. The MCU write is disabled to
avoid writing over the data being transmitted. No interrupt is generated because the error
status flag can be read upon completion of the transfer that was in progress at the time
of the error. This flag is automatically cleared by a read of the SPSR (with WCOL set)
followed by an access (read or write) to the SPDAT register.
MODF — SPI Mode Error Interrupt Status Flag
This bit is set automatically by SPI hardware if the MSTR control bit is set to one and the
SS input pin goes low. This condition is not permitted in normal operation. In the special
case where DDRD bit 5 is set to one, the Port D bit 5 pin is a general purpose output pin
rather than being dedicated as the slave select input for the SPI system. In this special
case the mode error function is inhibited and MODF remains at zero. This flag is
automatically cleared by a read of the SPSR (with MODF set) followed by a write to the
SPCR register.
8.4.3
Data I/O Register (SPDAT)
SPDAT
$102A
7
6
5
4
3
2
1
0
RESET:
BIT7
BIT6
BIT5
BIT4
BIT3
BIT2
BIT1
BIT0
READ:
Any time (normally only after SPIF flag set)
WRITE:
Any time (see WCOL write collision flag).
RESET:
Does not affect this register.
The serial peripheral data I/O register is used to transmit and receive data on the serial bus. Only
a write to this register will initiate transmission/reception of another byte, and this will only occur in
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