
Error Conditions
MOTOROLA
Serial Peripheral Interface (SPI)
11-17
Preliminary
11
Shift Register cannot occur until the transmission is completed. This implies a
back-to-back write to the Transmit Data Register is not possible. The SPTE indicates
when the next write can occur.
11.9 Error Conditions
The following flags signal SPI error conditions:
Overflow (OVRF) — Failing to read the SPI Data Register before the next full
length data enters the Shift Register sets the OVRF bit. The new data will not
transfer to the Receive Data Register, and the unread data can still be read. OVRF
is in the SPI Status and Control Register.
Mode Fault Error (MODF) — The MODF bit indicates the voltage on the Slave
Select pin (SS) is inconsistent with the mode of the SPI. MODF is in the SPI Status
and Control Register.
11.9.1 Overflow Error
The Overflow Flag (OVRF) becomes set if the Receive Data Register still has unread data
from a previous transmission and when bit one’s capture strobe of the next transmission
occurs. Bit 1capture strobe occurs in the middle of SCLK when the data length equals,
transmission data length minus one. If an overflow occurs, all data received after the
overflow, and before the OVRF bit is cleared, does not transfer to the Receive Data
Register. It does not set the SPI Receiver Full (SPRF) bit. The unread data transferred to
the Receive Data Register before the overflow occurred can still be read. Therefore, an
overflow error always indicates the loss of data. Clear the overflow flag by reading the SPI
Status and Control Register, then read the SPI Data Register.
OVRF generates a receiver/error interrupt request if the error interrupt enable bit (ERRIE)
is also set. It is not possible to enable MODF or OVRF individually to generate a
receiver/error interrupt request. However, leaving MODFEN low prevents MODF from
being set.
If the DSP SPRF interrupt is enabled and the OVRF interrupt is not, watch for an overflow
condition. Figure 11-11 explains how it is possible to miss an overflow. The first element
of the same figure illustrates how it is possible to read the SPSCR and SPDRR to clear the
SPRF without problems. However, as illustrated by the second transmission example, the
OVRF bit can be set between the time SPSCR and SPDRR are read.