DMA as double buffer

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,305件の閲覧回数
wendersonolivei
Contributor IV

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

ラベル(2)
タグ(4)
0 件の賞賛
1 解決策
802件の閲覧回数
Hui_Ma
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
803件の閲覧回数
Hui_Ma
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
802件の閲覧回数
wendersonolivei
Contributor IV

Hi Hui,

Thanks for help!

Regards

0 件の賞賛