English
Language : 

MC9S08RC8 Datasheet, PDF (176/234 Pages) Freescale Semiconductor, Inc – Microcontrollers
Serial Peripheral Interface (SPI) Module
13.4.4 SPI Status Register (SPI1S)
This register has three read-only status bits. Bits 6, 3, 2, 1, and 0 are not implemented and always read 0s.
Writes have no meaning or effect.
Bit 7
6
5
4
3
2
Read:
<st-blue>
SPRF
0
<st-blue> <st-blue>
SPTEF MODF
0
0
Write:
Reset: 0
0
1
0
0
0
= Unimplemented or Reserved
Figure 13-10. SPI Status Register (SPI1S)
1
Bit 0
0
0
0
0
SPRF — SPI Read Buffer Full Flag
SPRF is set at the completion of an SPI transfer to indicate that received data may be read from the SPI
data register (SPI1D). SPRF is cleared by reading SPRF while it is set, then reading the SPI data
register.
1 = Data available in the receive data buffer.
0 = No data available in the receive data buffer.
SPTEF — SPI Transmit Buffer Empty Flag
This bit is set when there is room in the transmit data buffer. It is cleared by reading SPI1S with SPTEF
set, followed by writing a data value to the transmit buffer at SPI1D. SPI1S must be read with
SPTEF = 1 before writing data to SPI1D or the SPI1D write will be ignored. SPTEF generates an
SPTEF CPU interrupt request if the SPTIE bit in the SPI1C1 is also set. SPTEF is automatically set
when a data byte transfers from the transmit buffer into the transmit shift register. For an idle SPI (no
data in the transmit buffer or the shift register and no transfer in progress), data written to SPI1D is
transferred to the shifter almost immediately so SPTEF is set within two bus cycles allowing a second
8-bit data value to be queued into the transmit buffer. After completion of the transfer of the value in
the shift register, the queued value from the transmit buffer will automatically move to the shifter and
SPTEF will be set to indicate there is room for new data in the transmit buffer. If no new data is waiting
in the transmit buffer, SPTEF simply remains set and no data moves from the buffer to the shifter.
1 = SPI transmit buffer empty.
0 = SPI transmit buffer not empty.
MODF — Master Mode Fault Flag
MODF is set if the SPI is configured as a master and the slave select input goes low, indicating some
other SPI device is also configured as a master. The SS1 pin acts as a mode fault error input only when
MSTR = 1, MODFEN = 1, and SSOE = 0; otherwise, MODF will never be set. MODF is cleared by
reading MODF while it is 1, then writing to SPI control register 1 (SPI1C1).
1 = Mode fault error detected.
0 = No mode fault error.
MC9S08RC/RD/RE/RG Data Sheet, Rev. 1.11
176
Freescale Semiconductor