Hi All,
I'm writing a code to output sound tones on DAC, with DMA. Due to precision that I need on tones, I need to use a dual buffer to process and output data via DMA (ping pong buffer).
Well, I've tried to process data and change the source address at DMA OnComplete event, but I haven't enough time to process all data. In some DMAs, we have a hardware trigger to do ping pong buffer; the DMA present in KL25Z can do that?
Thanks
Solved! Go to Solution.
It can use DMA channel link function, such as DMA CH0 as half low buffer and DMA CH1 as half top buffer.
DMA CH0 <=> DMA CH1.
When DMA CH0 finish the transfer link to DMA CH1 for transfer; and when DMA CH1 finish transfer, link to DMA CH0 start.
There need to use DMA continuous mode.
And in each DMA interrupt, the CPU can load new data to each DMA channel related data array.
Wish it helps.
best regards
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
It can use DMA channel link function, such as DMA CH0 as half low buffer and DMA CH1 as half top buffer.
DMA CH0 <=> DMA CH1.
When DMA CH0 finish the transfer link to DMA CH1 for transfer; and when DMA CH1 finish transfer, link to DMA CH0 start.
There need to use DMA continuous mode.
And in each DMA interrupt, the CPU can load new data to each DMA channel related data array.
Wish it helps.
best regards
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Hui,
Thanks for help!
Regards