cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to control the DAC via DMA with double buffering in an STM32F0 microcontroller?

JScho.599
Associate

I have DMA working in circular mode. However, after generating n cycles from a certain array, I would like to switch arrays without any processing time inbetween.

I believe this can be done with double buffering. However, this doesn't seem to be possible with the STM32F0.

2 REPLIES 2

Haven't looked but should allow for HT/TC interrupts to curate a Ping-Pong buffer, unpack data directly into the inactive half, rather than copy buffers.

Perhaps look at newer lower power and more capable parts.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Double-buffering is only in the two-port DMAs, i.e. in 'F2/'F4/'F7/('H7).

Clive's advice sounds viable.

Another trick - at a cost of some timers and DMA channels - might perhaps be, not to feed DAC using DMA channel triggered by DAC itself, but to feed it from a DMA channel triggered by a suitably timed timer. Then, you could use two such channels and switch between them just by enabling/disabling timers and/or the DMA channels, when needed.

JW

PS. Please change your username to a normal nick.