Skip to main content
Gaston
Associate III
Jun 8, 2021 8:42 AM UTC
Solved

ping-pong ADC + DMA

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

This topic has been closed for replies.
Piranha
PiranhaBest answer
Principal III
Jun 12, 2021 12:54 PM UTC

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.

2 replies

ST Technical Moderator
Jun 11, 2021 6:09 PM UTC

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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Piranha
PiranhaBest answer
Principal III
Jun 12, 2021 12:54 PM UTC

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.