cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP157 Dual ADC Data by DMA

Ken_102633
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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

View solution in original post

2 REPLIES 2

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
Guru

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