Serial Peripheral Interface Controller
UG0331 User Guide Revision 15.0
519
14.2.4.3 Interrupts
Interrupts can be set up to signal the completion of a data frame transmission or reception. There is one
interrupt signal from each SPI peripheral. The SPI_0_INT signal is generated by SPI_0 and is mapped to
INTISR [2] in the Cortex-M3 processor nested vectored interrupt controller (NVIC). The SPI_1_INT signal
is generated by SPI_1 and is mapped to INTISR [3] in the Cortex-M3 processor NVIC.
14.2.4.4 SPI Error Recovery and Handling
The SPI protocol defines only the packet formats for data transmission and does not include any error
recovery strategy for physical layer protocols. Specifically, if an error occurs on a slave, such as failing to
respond to the chip select or being overwhelmed with incoming data, the master will not necessarily be
aware of it. The master and slave must therefore have prior knowledge of each other's capabilities before
the transmission begins.
14.2.4.4.1 RX Overflow
An Rx overflow condition arises when the receive FIFO has not been emptied in time. As a result, the last
write to the receive FIFO from the channel, overwrites the data that is received earlier and which is not
read by the host processor. Eventually, the FIFO fills up and subsequent writes by the channel cause the
Rx to overflow. The corrective action for the bus master is to read from the FIFO until the FIFO is empty.
This can be checked by reading the FIFO status in the
register.
14.2.4.4.2 TX Under-Run
A Tx under-run condition arises when a channel requests to send data while no data is available in the
transmit FIFO. For example, when the SPI controller is operating in slave mode and receives a request to
send data, when no data is available in transmit FIFO. The corrective action for the bus master is to write
data into the transmit FIFO. The status flags (TXFIFOEMP or TXFIFOEMPNXT of the
register)
indicate whether the FIFO is empty or will be empty after the next read operation.
14.3
How to Use SPI
This section describes how to use SPI in an application.