I would like some clarification on the uDMA interaction with the TIVA SPI. I am setting up a slave SPI interface on the TIVA processor and would like to use the uDMA in PingPong mode with the SPI.
The SPI is configured as 16-bit wide element - SSI1 is used.
The uDMA is configured in PingPong mode
uDMAChannelControlSet(10 | UDMA_PRI_SELECT, UDMA_SIZE_16 | UDMA_SRC_INC_NONE | UDMA_DST_INC_16 | UDMA_ARB_4);
// Set up transfer buffers
uDMAChannelTransferSet(10| UDMA_PRI_SELECT, UDMA_MODE_PINGPONG, (void *)(SSI1_BASE + SSI_O_DR), &g_dsp_spi_rx_buffer[PRIMARY_BUFFER], 128);
// Configure alternate transfer of ping-pong transfer
uDMAChannelControlSet(10 | UDMA_ALT_SELECT, UDMA_SIZE_16 | UDMA_SRC_INC_NONE | UDMA_DST_INC_16 | UDMA_ARB_4);
uDMAChannelTransferSet(10 | UDMA_ALT_SELECT, UDMA_MODE_PINGPONG, (void *)(SSI1_BASE + SSI_O_DR), g_dsp_spi_rx_buffer[ALT_BUFFER],128);
While trying to get the DMA to work, I find that I need to enable the SPI RX DMA interrupt in order for the the DMA to work: SSIIntEnable(SSI1_BASE, SSI_DMARX). In addition, in the interrupt handler for SSI1, I need to clear the SSI_DMARX interrupt mask in order for more packets to get DMA'ed. This means that to receive a 128 element packet, the SSI ISR needs to run about 30 times else data is missed. Isn't the whole point of using a DMA to avoid having an interrupt to service transfer? I'm thinking I missed something in the datasheet and am hoping that someone can point me in the right direction.
Thank you
-Yan