Basic Operation
1505
SPNU563A – March 2018
Copyright © 2018, Texas Instruments Incorporated
Multi-Buffered Serial Peripheral Interface Module (MibSPI) with Parallel Pin
Option (MibSPIP)
28.2.4 Interrupts
There are two levels of vectorized interrupts supported by the SPI. These interrupts can be caused under
the following circumstances:
•
Transmission error
•
Receive overrun
•
Receive complete (receive buffer full)
•
Transmit buffer empty
These interrupts may be enabled or disabled via the SPIINT0 register.
During transmission, if one of the following errors occurs: BITERR, DESYNC, DLENERR, PARITYERR, or
TIMEOUT, the corresponding bit in the SPIFLG register is set. If the corresponding enable bit is set, then
an interrupt is generated. The level of all the above interrupts is set by the bit fields in the SPILVL register.
The error interrupts are enabled and prioritized independently from each other, but the interrupt generated
will be the same if multiple errors are enabled on the same level. The SPIFLG register should be used to
determine the actual cause of an error.
NOTE:
Since there are two interrupt lines, one each for Level 0 and Level 1, it is possible for a
programmer to separate out the interrupts for receive buffer full and transmit buffer empty.
By programming one to Level 0 and the other to Level 1, it is possible to avoid a check on
whether an interrupt occurred for transmit or for receive. A programmer can also choose to
group all of the error interrupts into one interrupt line and both TX-empty and RX-full
interrupts into another interrupt line using the LVL control register. In this way, it is possible
to separate error-checking from normal data handling.
28.2.4.1 Interrupts in Multi-Buffer Mode
In multi-buffer mode, the SPI can generate interrupts on two levels.
In normal multi-buffer operation, the receive and transmit are not used and therefore the enable bits of
SPIINT0 are not used.
The interrupts available in multi-buffer mode are:
•
Transmission error interrupt
•
Receive overrun interrupt
•
TG suspended interrupt
•
TG completed interrupt
When a TG has finished and the corresponding enable bit in the TGINTENA register is set, a transfer-
finished interrupt is generated. The level of priority of the interrupt is determined by the corresponding bit
in the TGINTLVL register.
When a TG is suspended by a buffer that has been set as suspend to wait until TXFULL flag or/and
RXEMPTY flag are set, and if the corresponding bit in the TGINTENA register is set, an transfer-
suspended interrupt is generated. The level of priority of the interrupt is determined by the corresponding
bit in the TGINTLVL register.
illustrates the TG interrupts.
During transmission, if one of the following errors occurs, BITERR, DESYNC, PARITYERR, TIMEOUT,
DLENERR, the corresponding flag in the SPIFLG register is set. If the enable bit is set, then an interrupt is
generated. The level of the interrupts could be generated according to the bit field in SPILVL register.