Repeat sequence of ADC conversions using DMA
Hi All,
I need to do 13 ADC conversions using DMA. And also need to repeat it 10 times so that I can take average for all the 13 values. Here's the code I'm using:
static uint16_t adcDataArrayBeforeAvg[130];
HAL_ADC_Start_DMA(&hadc, (uint32_t *)adcDataArrayBeforeAvg, 130);
ADC Config:
hadc.Init.EOCSelection = ADC_EOC_SEQ_CONV;
hadc.Init.LowPowerAutoWait = DISABLE;
hadc.Init.LowPowerAutoPowerOff = DISABLE;
hadc.Init.ContinuousConvMode = DISABLE;
hadc.Init.DiscontinuousConvMode = DISABLE;
hadc.Init.ExternalTrigConv = ADC_SOFTWARE_START;
hadc.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
hadc.Init.DMAContinuousRequests = ENABLE;
hadc.Init.Overrun = ADC_OVR_DATA_PRESERVED;
I'm expecting the DMA to repeat the sequence of conversions 10 times and generate an interrupt finally. But HAL_ADC_ConvCpltCallback is not getting called.
NOTE: If I just convert 13 values like below, HAL_ADC_ConvCpltCallback is getting invoked.
HAL_ADC_Start_DMA(&hadc, (uint32_t *)adcDataArrayBeforeAvg, 13);
Is what I'm trying to achieve possible or am I doing something wrong here?
Thanks,
Prakash
