I'm having an issue with uDMA and SSI on the TM4C123GXL launchpad board. When I'm communicating with a slave device. I have the master and slaved wire like at the end of the post and am sending some data to SPI. The data transfered should look like this:
TX: 0x40 0x2A 0x00 0x02 0x00 0x00 0x40 0x01 0x00 0x01 0x00 0x40 0x22 0x00 0x02 0x00 0x00
RX: 0x00 0x00 0x00 0x00 0x00 0x3E 0x00 0x00 0x00 0x00 0x42 0x00 0x00 0x00 0x00 0x00 0x00
To perform this transfer, I ensure that the SSI Rx queue is empty. After that I enable the uDMA channel for RX, then the uDMA channel for TX similar to the UDMA demo, but using UDMA_MODE_BASIC. However, when I look at the received data, the position of received data is shift by 1-4 places depending on the arbitration size. Rather than it looking like the above, which is what a waveform puts out of the physical signal, I get the following when using an arbitration size of 4.
TX: 0x40 0x2A 0x00 0x02 0x00 0x00 0x40 0x01 0x00 0x01 0x00 0x40 0x22 0x00 0x02 0x00 0x00
RX: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x3E 0x00 0x00 0x00 0x00 0x42 0x00 0x00
Does anyone know why this is happening? It seems like when I enable the uDMAChannel, it instantly reads 4 bytes of data regardless of if there is data there or not. Is there a way to delay the first arbitration so that is ensured the RX queue is at least half full?
SSI0_Tx -> MOSI
SSI0_Rx -> MISO
SSI0_Fss -> CS
SSI0_CLK -> SCLK