AnsweredAssumed Answered

How to define the data conversion order in multichannel ADC

Question asked by mao on May 13, 2016
Latest reply on May 18, 2016 by mao
Hi
I am using stm32f4 chip to do multichannel ADC conversion. Very hard to figure out the ordr of the channel scanning.
What do you think which channel was scanned first in the following codes? Very surprised that Ch4 was scanned first. I can't figure out why.
  /**Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.
  */
       
sConfig.Channel = ADC_CHANNEL_3;
sConfig.Rank = 1;
sConfig.SamplingTime = ADC_SAMPLETIME_15CYCLES;  //each conversion takes 3+15=18cycles. 18/12MHz=1.5us.
 
HAL_ADC_ConfigChannel(&hadc1, &sConfig);
 
  /**Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.
  */
sConfig.Channel = ADC_CHANNEL_4;//PA4
sConfig.Rank = 2;
HAL_ADC_ConfigChannel(&hadc1, &sConfig);

Outcomes