Main process
Start the channel:
Set SPIm.MCSPI_CHxCTRL[0] EN bit to 1
LAST_TRANSFER = TRUE
Interrupt routine
Read SPIm.MCSPI_IRQSTATUS
Write SPIm.MCSPI_IRQSTATUS
to reset channel status bits
TX empty?
WRITE_COUNT < w?
LAST_TRANSFER
= TRUE
Return
Read
SPIm.MCSPI_CHxSTAT
SPIm.
MCSPI_CHxSTAT[2:1]
= 0x3?
Stop the channel:
Set SPIm.MCSPI_CHxCTRL[0] to 0
Next command
mcspi-024
Disable DMA write request:
Reset SPIm.MCSPI_CHxCONF[14] DMAW bit
WRITE_COUNT = w
Yes
No
No
Yes
Yes
No
Public Version
www.ti.com
McSPI Basic Programming Model
Figure 20-30. Transmit-Only With DMA (Master and Slave)
20.6.2.5 Receive-Only Procedure
20.6.2.5.1 Master Normal Receive-Only Procedure
20.6.2.5.1.1 Based on Interrupt Requests
shows the handling procedure for words received by interrupt in master normal receive-only
mode. The main process flow shows how the end-of-transfer must be done after all words are received for
this mode.
3017
SWPU177N – December 2009 – Revised November 2010
Multichannel SPI
Copyright © 2009–2010, Texas Instruments Incorporated