mcspi-028
Main process
Start the channel:
Set SPIm.MCSPI_CHxCTRL[0] EN bit to 1
CHANNEL_ENABLE = TRUE
Interrupt routine
Disable DMA read request:
Reset SPIm.MCSPI_CHxCONF[15] DMAR bit
LAST_TRANSFER
= TRUE
WRITE_COUNT = w-2
Read
SPIm.MCSPI_CHxSTAT
SPIm.
MCSPI_CHxSTAT[2:1]
= 0x3?
Stop the channel:
Set SPIm.MCSPI_CHxCTRL[0] EN bit to 0
CHANNEL_ENABLE = FALSE
Next command
Return
Read SPIm.MCSPI_IRQSTATUS
Write SPIm.MCSPI_IRQSTATUS
to reset channel status bits
RX full?
READ_COUNT
= w - 2?
LAST_TRANSFER = TRUE
CHANNEL_ENABLE
= FALSE
READ_COUNT < w?
Read
SPIm.MCSPI_RXx
REA=1
No
Yes
No
No
Yes
Yes
No
Yes
Public Version
www.ti.com
McSPI Basic Programming Model
Figure 20-34. Receive-Only With DMA (Master Turbo)
20.6.2.5.3 Slave Receive-Only Procedure
shows the handling procedure for words received by interrupt in slave receive-only mode.
The main process shows how the end-of-transfer must be done after all words are received for this mode.
If the requests are configured in DMA, READ_COUNT is assigned the value w when the DMA handler
completes w interface processes.
3021
SWPU177N – December 2009 – Revised November 2010
Multichannel SPI
Copyright © 2009–2010, Texas Instruments Incorporated