Skip to main content
Associate II
August 21, 2023
Solved

STM32MP157 Dual ADC Data by DMA

  • August 21, 2023
  • 2 replies
  • 1508 views

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.

This topic has been closed for replies.
Best answer by TDK

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.)

2 replies

Associate II
August 21, 2023

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.

TDK
TDKBest answer
August 21, 2023

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.)

"If you feel a post has answered your question, please click ""Accept as Solution""."