
Chapter 9 Serial Peripheral Interface (SPIV3)
MC9S12E128 Data Sheet, Rev. 1.07
Freescale Semiconductor
297
9.5
Reset
The reset values of registers and signals are described in the Memory Map and Registers section (see
If a data transmission occurs in slave mode after reset without a write to SPIDR, it will transmit
garbage, or the byte last received from the master before the reset.
Reading from the SPIDR after reset will always read a byte of zeros.
9.6
Interrupts
The SPIV3 only originates interrupt requests when SPI is enabled (SPE bit in SPICR1 set). The following
is a description of how the SPIV3 makes a request and how the MCU should acknowledge that request.
The interrupt vector offset and interrupt priority are chip dependent.
The interrupt ags MODF, SPIF and SPTEF are logically ORed to generate an interrupt request.
9.6.1
MODF
MODF occurs when the master detects an error on the SS pin. The master SPI must be congured for the
MODF feature (see
Table 9-3). After MODF is set, the current transfer is aborted and the following bit is
changed:
MSTR = 0, The master bit in SPICR1 resets.
The MODF interrupt is reected in the status register MODF ag. Clearing the ag will also clear the
interrupt. This interrupt will stay active while the MODF ag is set. MODF has an automatic clearing
9.6.2
SPIF
SPIF occurs when new data has been received and copied to the SPI Data Register. After SPIF is set, it
does not clear until it is serviced. SPIF has an automatic clearing process which is described in
the next transfer (i.e. SPIF remains active throughout another transfer), the latter transfers will be ignored
and no new data will be copied into the SPIDR.
9.6.3
SPTEF
SPTEF occurs when the SPI Data Register is ready to accept new data. After SPTEF is set, it does not clear
until it is serviced. SPTEF has an automatic clearing process which is described in
Section 9.3.2.4, “SPI