DMA Dynamic Scatter gathering Questions

ajc225

Active member
I'm working on a project where I am using DMA. The teensy is receiving data at a rate of 10kHz through serial. I'm using DMA to store the incoming data, in a 2D array buffer of 10000x5. I was wondering if using the dynamic scattering/gather method with channel linking is a good idea. My idea was to have the major loop go through the dimension with 5 elements and update the destination address of the TCD to go through the dimension with 10000 elements. However, I have some questions about how the DMA channels utilize the TCD.

1. When does the channel use the TCD? Does it "refer" to the TCD' source and destination addresses after every major loop, minor loop, or only once when it is initialized? I ask this because if it refers to the TCD multiple times then why could I not just use the same TCD and change the destination address after the channel finishes every major loop without using scatter/gather? Otherwise, I was thinking that I could use the same TCD and change the address after it finishes the major loop and input DLASTSGA as the address of the current TCD. If not, do I need to have 10000 TCDs or can I swap between 2 TCDs and update one while the other is being used?

2. Furthermore, when would be the best time to update the TCD? I saw that the channel CSR start or done bit changes based off of where the channel is in the loop. Which bit makes sense to link the TCD update to or is there another bit that I might be overlooking?

Thank you for taking the time to answer my questions.
 
Last edited:
Back
Top