www.ti.com
Functional Description
279
SWRU543–January 2019
Submit Documentation Feedback
Copyright © 2019, Texas Instruments Incorporated
SPI (Serial Peripheral Interface)
To avoid having a TX_underflow event at the beginning of a transmission, TX_underflow is not activated
when no data has been loaded into the transmitter register, because the channel has been enabled. The
TX_underflow interrupt status bit must be cleared for an interrupt line deassertion (if the event is enabled
as the interrupt source).
8.2.4.1.3 RX_ full
The RX_full event is activated when the channel is enabled and the receiver is filled (transient event).
When the FIFO buffer is enabled (MCSPI_CHCONF[FFER] set to 1), the RX_full event is asserted when a
certain number of bytes are held in the buffer to read, as defined by MCSPI_XFERLEVEL[AFL].
The receiver register must be read to remove the source of the interrupt, and the RX_full interrupt status
bit must be cleared for an interrupt line deassertion (if the event is enabled as an interrupt source).
When FIFO is enabled, no new RX_full event is asserted until the local host has not performed the
number of reads into the receive register defined by MCSPI_XFERLEVEL[AFL]. The local host must
perform the correct number of reads.
8.2.4.1.4 RX_overflow
The RX_overflow event is activated when the channel is enabled and the receiver register or FIFO (if the
buffer is enabled) is full at the time of a new SPI word reception. The receiver register is always
overwritten with the new SPI word. If the FIFO is enabled and the data within the FIFO is overwritten, it
must be corrupted.
The RX_overflow event should not appear in slave mode using the FIFO. The RX_overflow event
indicates an error (data loss) in slave mode. The RX_overflow interrupt status bit must be cleared for an
interrupt line deassertion (if the event is enabled as an interrupt source).
8.2.4.1.5 End-of-Word Count
The EOW (end-of-word count) event is activated when the channel is enabled and configured to use the
built-in FIFO. This interrupt is raised when the controller performs the number of transfers defined in the
MCSPI_XFERLEVEL[WCNT] register. If the value is programmed to 0x0000, the counter is not enabled
and this interrupt is not generated.
The EOW count interrupt also indicates that the SPI transfer is stopped on the channel (using the FIFO
buffer), until MCSPI_XFERLEVEL[WCNT] is not reloaded and the channel re-enabled. The EOW interrupt
status bit must be cleared for the interrupt line deassertion (if the event is enabled as an interrupt source).
8.2.4.2 Slave Transmit and Receive Mode
The slave transmit and receive mode is programmable (TRM bits set to 00 in the register SPI_CHCONF).
After the channel is enabled, transmission and reception proceed with interrupt and DMA request events.
In slave transmit and receive mode, the transmitter register should be loaded before the SPI is selected by
an external SPI master device. The transmitter register or FIFO (if the use of a buffer is enabled) content
is always loaded in the shift register, whether updated or not. The TX_underflow event activates, and does
not prevent transmission.
Upon completion of SPI word transfer (the EOT bit of the SPI_CHSTAT register is set), the received data
is transferred to the channel receive register. This bit is meaningless when using the buffer for this
channel.
The built-in FIFO is available in this mode and can be configured in one data direction, either transmit or
receive, to ensure that the FIFO is seen as a unique 64-byte buffer. The FIFO can also be configured in
both data transmit and receive directions, to ensure the FIFO is split into two separate 32-byte buffers with
individual address space management. In this last case, the definition of the AEL and AFL levels is based
on 64 bytes, and is the responsibility of the local host.