Kinetis K24 eDMA major loop limitation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Kinetis K24 eDMA major loop limitation

1,041 Views
mikethomas
Contributor II

I have a 16 bit peripheral that I need to stream 180k bytes to. (90k 16 bit words).

The data stream needs to be strobed into the peripheral with a 5MHz clock.

The stream needs to be clocked precisely every 200nS.

My dilemma is that since the stream must be precisely controlled (1 xfer per strobe) , I need to set the minor loop count for 1 xfer,

and the major loop for 90k 16 bit transfers. But the maximum limit for a major loop count is either 32678 with no channel linking

or 512 with channel linking.

If I go with the maximum non linked major loop count and have the eDMA generate an interrupt on completion, I cannot guarantee the ISR will setup the eDMA

and re-start it within 200nS, as this ISR will likely have a lower priority than another critical task. I really don't want to have the CPU intervene in these transfers anyway if I can help it.

The only solution I can come up with is; set up 3 DMA channels to transfer 30k words each, each channel starting from where another channel left off,  then somehow (maybe by some external gating circuit or using the timers) use the 5MHz strobe and FTM timers to sequentially request 30k xfers on channels 1, 2 then 3. After channel 3 exhausts its 30k major loop count, an interrupt would be generated.

Is there any other way to transfer 180k bytes with precisely controlled requests without CPU intervention using this eDMA module?

Thanks in advance,

Mike

0 Kudos
Reply
2 Replies

625 Views
EarlOrlando
Senior Contributor II

Hello Mike,

The scatter/gather dynamic programming will solve your problem. I recommend you to read the section 21.5.7.3 "Dynamic scatter/gather" in the MK24 Reference Manual to obtain a better understanding about this mode of operation where you can configure many TCDs (Transfer Control Descriptors) for the same channel. A new TCD is loaded (i.e. the channel is reconfigured by itself) when the DMA_TCDn_CITER register reaches 0 so you could configure 3 TCDs with 30k transactions on each one. Also, if you need to do those 90k transactions periodically, you can configure the last TCD to be loaded with the first one once the last TCD finishes its 30k transactions.

Best regards,

Earl.

0 Kudos
Reply

625 Views
EarlOrlando
Senior Contributor II

Hello again Mike,

I want to share with you the document in the link below to complement my last answer about the eDMA's scatter/gather feature.

What is and how to configure the eDMA scatter/gather feature

Best regards,
Earl Ramírez.

0 Kudos
Reply