Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User10696
Level 4
Level 4
First solution authored
I need to send a continuous stream of data via a USIC. I am planning to use 2 data buffers to prepare the date and then transfer the data using DMA.
What is the best way to continuously swap between the 2 buffers? Can the "Gather" function be used or is it better to use a linked list and update the address after each block is finished?
Or is there another method which I do not know? I guess this is a common requirement so there is probably a good and easy solution.
Any code example would be useful.
0 Likes
1 Reply
Not applicable
You can use the Linked List Feature of the DMA Controller 0 Channel 0/1. Create a linked list item which copies data into your buffer, link the list item to itself (circular). The channel is now continuously running. Poll the Destination address Register to get the current DMA write pointer. Then you can read data from the last known Position until current Destination pointer.
0 Likes