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.

EDMA3 Peripheral servicing with time slice

Hi,

I have a questions regarding using EDMA and McSPI peripheral.  I want to organise the communication with McSPI  with using of EDMA. The transaction  must be started every 10 millisecond.  Also ping-pong buffer is using.

I want to combine linking mechanism with events enable. At the start of the system I configure three PaRAMs. One initial, and one linked one by other to provide ping pong buffering. I set EMDA interrupt to be generated on completion. Transmission takes about 1 ms time.  Every 10 ms I enable McSPI DMA event in the McSPI peripheral, as McSPI buffer is empty, transmission is started.  On the completion of transmission interrupt is generated. In the interrupt handler I disable the event, and wait for other 10ms timer tick to enable it.  

As I understand from TRM the link update occurs after the current PaRAM set event parameters have been exhausted. An event's parameters are exhausted when the EDMA3 channel controller has submitted all the transfers associated with the PaRAM set. At the same time on my system interrupt is generated. What happens when because of interrupt latency I will disable the McSPI event after PaRAM will be replaced from linked parameters. The new transfer will be started as I understand with linked PaRAM set. And my goal is to start the transfer on 10 ms timer. 

How can I avoid this situation ? I'm thinking about using TCCMODE early completion. But will that time be enough to disable peripheral event ? Maybe there is best approach for solving such kind of problem ?