I have EK-LM4F232.
I need to transfer a buffer through SSI1 (SPI) every 40ms possibly without interrupt handling.
Is possible to program TIMER4 B to trigger the transfer?
How should I configure TIMER 4, SSI1 and DMA registers?
best regards
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I have EK-LM4F232.
I need to transfer a buffer through SSI1 (SPI) every 40ms possibly without interrupt handling.
Is possible to program TIMER4 B to trigger the transfer?
How should I configure TIMER 4, SSI1 and DMA registers?
best regards
A couple of questions come to mind that would affect the answer to your questions:
* How large is the buffer that is being transmitted every 40ms?
* Is the same data or buffer being transmitted each time, or is it a different buffer?
Yes, any of the timers can be configured to trigger a uDMA transfer. But, if the timer triggers it, the peripheral does not control the transfer. Hence, the entire transfer must fit inside the SSI FIFO (8 entries), assuming of course that you _know_ that the FIFO is empty when the timer trigger occurs.
How the data is generated/created is also important. If new data is generated after the previous data has been transmitted, then this naturally wants an interrupt anyway (so you know when the previous data has been transmitted without having to poll for that situation).
--Brian
the buffer is 140 bytes long, and is always the same buffer being transimetted.
according to what you say, I understand that I must relax the interrupt constraint. The timer trigger an interrupt, in the interrupt handle I enable SSI1 DMA channel to start a transfer.
Another question: using basic mode I need to reinitialize the control table entry (with ROM_uDMAChannelTransferSet()) and reenable the channel (with ROM_uDMAChannelEnable(UDMA_CHANNEL_SSI1TX)) every time.
How can I avoid this behaviour? Maybe using scatter-gather peripheral?
Where can I find examples of Scatter-Gather Peripheral mode?
best regards
In order to transfer 140 bytes, you need to have the SSI module control the uDMA transfer. Therefore, you can not use a timer triggered transfer.
On each 40ms timer interrupt, you will need to configure and start the uDMA transfer to the SSI module. The SSI module will then complete the transfer in the background along with the uDMA.
The problem with trying to automatically re-arm the uDMA is that the SSI module will continuously request uDMA transfers; hence once you've re-armed the uDMA it will immediately re-transfer your buffer (not what you desire...you want it to wait until the next 40ms tick).
Though not for your board/part, you can find a scatter-gather example in boards/ek-lm3s9b90/udma_uart_sg. Since it uses only the UART and uDMA peripherals, it should run on your LM4F232 with only minor modifications (the MOSC crystal frequency being the only thing I can think of that might be different).
--Brian