SPI1_S field descriptions (continued)
Field Description
5
SPTEF
SPI Transmit Buffer Empty Flag (when FIFO is not supported or not enabled) or SPI transmit FIFO empty
flag (when FIFO is supported and enabled)
When the FIFO is not supported or not enabled (FIFOMODE is not present or is 0): This bit is set when
the transmit data buffer is empty. SPTEF is cleared by reading the S register with SPTEF set and then
writing a data value to the transmit buffer at DH:DL. The S register must be read with SPTEF set to 1
before writing data to the DH:DL register; otherwise, the DH:DL write is ignored. SPTEF is automatically
set when all data from the transmit buffer transfers into the transmit shift register. For an idle SPI, data
written to DH:DL is transferred to the shifter almost immediately so that SPTEF is set within two bus
cycles, allowing a second set of data to be queued into the transmit buffer. After completion of the transfer
of the data in the shift register, the queued data from the transmit buffer automatically moves to the shifter,
and SPTEF is set to indicate that room exists 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.
When the FIFO is supported and enabled (FIFOMODE is 1): This bit provides the status of the FIFO rather
than of an 8-bit or a 16-bit buffer. This bit is set when the transmit FIFO is empty. SPTEF is cleared by
writing a data value to the transmit FIFO at DH:DL. SPTEF is automatically set when all data from the
transmit FIFO transfers into the transmit shift register. For an idle SPI, data written to the DH:DL register is
transferred to the shifter almost immediately, so that SPTEF is set within two bus cycles. A second write of
data to the DH:DL register clears this SPTEF flag. After completion of the transfer of the data in the shift
register, the queued data from the transmit FIFO automatically moves to the shifter, and SPTEF will be set
only when all data written to the transmit FIFO has been transfered to the shifter. If no new data is waiting
in the transmit FIFO, SPTEF simply remains set and no data moves from the buffer to the shifter.
0 SPI transmit buffer not empty (when FIFOMODE is not present or is 0) or SPI FIFO not empty (when
FIFOMODE is 1)
1SPI transmit buffer empty (when FIFOMODE is not present or is 0) or SPI FIFO empty (when
FIFOMODE is 1)
4
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 SS pin acts as a mode fault error input only when
C1[MSTR] is 1, C2[MODFEN] is 1, and C1[SSOE] is 0; otherwise, MODF will never be set. MODF is
cleared by reading MODF while it is 1 and then writing to the SPI Control Register 1 (C1).
0 No mode fault error
1 Mode fault error detected
3
RNFULLF
Receive FIFO nearly full flag
This flag is set when more than three 16-bit words or six 8-bit bytes of data remain in the receive FIFO,
provided C3[4] is 0, or when more than two 16-bit words or four 8-bit bytes of data remain in the receive
FIFO, provided C3[4] is 1. It has no function if FIFOMODE is not present or is 0.
0 Receive FIFO has received less than 48 bits (when C3[4] is 0) or less than 32 bits (when C3[4] is 1)
1 Receive FIFO has received data of an amount equal to or greater than 48 bits (when C3[4] is 0) or 32
bits (when C3[4] is 1)
2
TNEAREF
Transmit FIFO nearly empty flag
This flag is set when only one 16-bit word or two 8-bit bytes of data remain in the transmit FIFO, provided
C3[5] is 0, or when only two 16-bit words or four 8-bit bytes of data remain in the transmit FIFO, provided
C3[5] is 1. If FIFOMODE is not enabled, ignore this bit.
NOTE: At an initial POR, the values of TNEAREF and RFIFOEF are 0. However, the status (S) register
and both TX and RX FIFOs are reset due to a change of SPIMODE, FIFOMODE or SPE. If this
Table continues on the next page...
Chapter 16 16-Bit Serial Peripheral Interface (16-Bit SPI)
S9S08RN60 Reference Manual, Rev. 1, 01/2014
Freescale Semiconductor, Inc. 457