cancel
Showing results for 
Search instead for 
Did you mean: 

ping-pong ADC + DMA

Gaston
Senior

Hi,

I've configured ADC + DMA to get a single 12-bit sample (of 7 channels) from an ISR routine. However I'd like to implement a double-buffer 'ping-ping' mechanism in order to process the chunk [7][1024] data at the end of acquisition. This is at sample number 1024 of channel 7.

Is there any example for the STM32L4 family with this implementation?

thanks in advance,

gaston

1 ACCEPTED SOLUTION

Accepted Solutions
Piranha
Chief II

Some series have dual memory buffer support, but L4 doesn't have that feature. The next best option is to set the DMA in circular mode and use HT (half transfer) and TC (transfer complete) interrupts to process the data on the first or the second half of the buffer.

View solution in original post

2 REPLIES 2
Imen.D
ST Employee

Hello @Gaston​ ,

Have a look at the ADC_DMA example within STM32CubeL4 MCU package, and you will probably find in the package a board that fit your need.

STM32Cube_FW_L4_V1.17.0\Projects\STM32L476G-EVAL\Examples\ADC\ADC_DMA_Transfer

You find a readme file describing how to test the application and you may update the example according to your needs.

Hope this helps you!

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Piranha
Chief II

Some series have dual memory buffer support, but L4 doesn't have that feature. The next best option is to set the DMA in circular mode and use HT (half transfer) and TC (transfer complete) interrupts to process the data on the first or the second half of the buffer.