AnsweredAssumed Answered

ADC + DMA circular mode

Question asked by Lukasz Przenioslo on Apr 6, 2016
Latest reply on Apr 6, 2016 by FTITI.Walid
Hello there,
I am trying to configure ADC and DMA (STM32F4) to work in circullar mode but I fail. There is a lot more conversions than there should be and they are starving other "processes" in the mcu.

This is what I am trying to do exacly. TIM8 is running at 20k (PWM, center aligned). An update event of TIM8, should trigger ADC that would measure 8 samples (2 channels, 4 samples per channel, one by one). At the end of those 8 conversions an interrupt should be triggered and this would go on and on after. This is my configuration:

ADC3:
https://pastebin.com/8uNh2TAg

DMA:
https://pastebin.com/F8dXcJMR

I start the DMA with:
retVal += HAL_ADC_Start_DMA(motor->currentLoopAdc,
                (uint32_t*)motor->adcSamples, motor->adcSamplesMax);

adcSamples is an array of 16 elements (int16). adcSamplesMax at this moment is 8, as I want to take 8 measurements. I would apreciate all help!

Outcomes