I read all frms and could not make the dma with spi work yet.
The example in DS70005185A-page 34 are, in part, wrong.
Without dma, the spi are workink and i am using enhanced buffer.
In DS70005185A-page 2 say: When using the SPI module with DMA, the FIFO operation can be disabled.
In DS70005185A-page 33 say: When using the SPIx module with DMA, the SPIBEN bit can be programmed to ‘0’, thereby disabling FIFO operation.
"CAN" != "SHOULD".
The frms should be clearer, and with better, correct and more code examples.
And if the dma not work with enhanced buffer, this seems to me like a big project bug.
Why "SPI2STATbits.SISEL" in 4 or 6 mode can not be used to trigger a dma request ?
SPI2STATbits.SISEL = 4; // mode = 4 -> Interrupt when one data is shifted into the SPIxSR and as a result, the TX FIFO has one open memory location.
// mode = 6 -> Interrupt when last bit is shifted into SPIxSR and as a result, the TX FIFO is empty.
// For DMA configuration, trigger a dma request ??????
* I only need master transmit mode with dma !!!!
* I need setup two dma channels(1 receive and 1 transmit) to spi work with dma in master transmit only ?
* I need to enable spi interrupt ? (Example code in DS70005185A-page 34 and page 35 are enabled). In UARt dma i dont need enable tx interrupt. I only set "Interrupt after one TX character is transmitted. For DMA configuration, trigger a DMA request".
* SPI with dma need to disable enhanced buffer mode ?
* In another project a few years ago, i have already been able to configure uart transmitter using DMA and it worked perfectly.
* I dont use MCC, i use "pure" XC16.
post edited by rangel - 2019/04/11 13:15:08