2023-08-21 04:28 AM
Hi all,
I trigger the ADC through TIM 2(1HZ/s) and set the ADC to Dual Mode. ADC1 & 2 each have 5 channels.
multimode.Mode = ADC_DUALMODE_REGSIMULT;
multimode.DualModeData = ADC_DUALMODEDATAFORMAT_32_10_BITS;
multimode.TwoSamplingDelay = ADC_TWOSAMPLINGDELAY_1CYCLE;
if (HAL_ADCEx_MultiModeConfigChannel(&hadc1, &multimode) != HAL_OK)
{
Error_Handler();
}
I want to know if I use HAL_ADCEx_MultiModeStart_DMA to start ADC conversion.
The size of my Data array is a multiple of Channels, then it means TIM2 trigger more than once?
// Convert once
uint32_t adcData1[5];
HAL_ADCEx_MultiModeStart_DMA(&hadc1,(uint32_t*)adcData1,(uint32_t)ADC_CONVERTE_BUFFER_MAX_SIZE)
// Convert 40 times ?? Timer trigger 40 times??
uint32_t adcData2[200];
HAL_ADCEx_MultiModeStart_DMA(&hadc1,(uint32_t*)adcData2,(uint32_t)ADC_CONVERTE_BUFFER_MAX_SIZE)
Thank you.
Solved! Go to Solution.
2023-08-21 06:16 AM
TIM2 will continuously trigger. DMA will continue to shove things into the buffer until the length is reached, then the DMA will stop, but the timer will still be triggering.
(That last reply was a bot. Which is why it sort of answered your question, but not really.)
2023-08-21 04:53 AM
Hello kylee009,
Thanks for your reply.
It means that when using HAL_ADCEx_MultiModeStart_DMA with a larger data array, such as adcData2.
TIM2 trigger the ADC once will continuously fill adcData2 until it reaches full capacity.
Is my understanding correct?
Best Regards.
2023-08-21 06:16 AM
TIM2 will continuously trigger. DMA will continue to shove things into the buffer until the length is reached, then the DMA will stop, but the timer will still be triggering.
(That last reply was a bot. Which is why it sort of answered your question, but not really.)