![](http://datasheet.mmic.net.cn/370000/P9S12XEP100J1VVLR_datasheet_16728329/P9S12XEP100J1VVLR_780.png)
Chapter 20 Serial Peripheral Interface (S12SPIV5)
MC9S12XE-Family Reference Manual , Rev. 1.07
780
Freescale Semiconductor
20.3.2.4
SPI Status Register (SPISR)
Read: Anytime
Write: Has no effect
Table 20-8. SPIF Interrupt Flag Clearing Sequence
Module Base +0x0003
7
6
0
5
4
3
0
2
0
1
0
0
0
R
W
SPIF
SPTEF
MODF
Reset
0
0
1
0
0
0
0
0
= Unimplemented or Reserved
Figure 20-6. SPI Status Register (SPISR)
Table 20-7. SPISR Field Descriptions
Field
Description
7
SPIF
SPIF Interrupt Flag
— This bit is set after received data has been transferred into the SPI data register. For
information about clearing SPIF Flag, please refer to
Table 20-8
.
0 Transfer not yet complete.
1 New data copied to SPIDR.
5
SPTEF
SPI Transmit Empty Interrupt Flag
— If set, this bit indicates that the transmit data register is empty. For
information about clearing this bit and placing data into the transmit data register, please refer to
Table 20-9
.
0 SPI data register not empty.
1 SPI data register empty.
4
MODF
Mode Fault Flag
— This bit is set if the SS input becomes low while the SPI is configured as a master and mode
fault detection is enabled, MODFEN bit of SPICR2 register is set. Refer to MODFEN bit description in
Section 20.3.2.2,“SPIControlRegister 2(SPICR2)”
.Theflagis clearedautomaticallybyaread ofthe SPIstatus
register (with MODF set) followed by a write to the SPI control register 1.
0 Mode fault has not occurred.
1 Mode fault has occurred.
XFRW Bit
SPIF Interrupt Flag Clearing Sequence
0
Read SPISR with SPIF == 1
then
Read SPIDRL
1
Read SPISR with SPIF == 1
then
Byte Read SPIDRL
1
1
Data in SPIDRH is lost in this case.
2
SPIDRH can be read repeatedly without any effect on SPIF. SPIF Flag is cleared only by the read
of SPIDRL after reading SPISR with SPIF == 1.
or
Byte Read SPIDRH
2
Byte Read SPIDRL
or
Word Read (SPIDRH:SPIDRL)