Skip to main content
Gaston
Associate III
June 8, 2021
Solved

ping-pong ADC + DMA

  • June 8, 2021
  • 2 replies
  • 2054 views

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.
Best answer by Piranha

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
June 11, 2021

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
June 12, 2021

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.