2016-04-05 11:38 PM
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: DMA: 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!2016-04-06 02:28 AM
Hi Bremen,
Please, try to clarify more your problem/issue. Have you tried to debug ? where your code fails exactly ? Is this an ADC or DMA matter ? Your code seems to do not configure DMA in case of ADC3 ! -Hannibal-2016-04-06 02:49 AM
Yes the matter is only with ADC2 not 3. I mistyped. I did some tests and I found the problem. When I turn ON Circular with DMA, I have to turn off continuous conversions with ADC...
Thank you for answer.2016-04-06 04:42 AM
Hi Bremen,
Good. Keep up the good work . -Hannibal-