cancel
Showing results for 
Search instead for 
Did you mean: 

ADC conversion using End of Conversion Selection?

SWenn.1
Senior III

Good evening....

I would like to do an A/D conversion on Channel 9 and Channel 10. I have a timer that goes off every second and within this ISR I call HAL_ADC_Start_IT. The ISR gets called upon conversion complete. Now the question is End of Conversion Selection: Should it be 'End of Single Conversion' or 'End of Sequence of Conversion'?? Even though I am sampling multiple channels is this considered a sequence or a single conversion of multiple channels, given that I am using a timer to trigger this single event every second???? This is not explained well and confusing.

Thanks

Steve

4 REPLIES 4
OAgui.1
Associate II

Please, anyone can answer this question?

Same doubt for me.

Oliver

AScha.3
Chief III

rtfm.

depends on your selection, what ISR you want/need:

0693W00000SwFDcQAN.png

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

There is no EOS flag!

From the ADC block diagram

PFC_3-1711980639422.png

PFC_0-1711980156978.png

But, the End of Conversion (EOC) flag (in ADC_SR reg) can be triggered at the end of each conversion or at the end of a sequence, depending on the EOCS bit (in ADC_CR2 reg)

 

 

PRenn.1
Associate III

Close but no cigar.  The OP wanted to know what to do in case of a  multi channel conversion Setup.
I just tried that on a STM32F411 with four channels setup.   The ADC-with-DMA is started every 100ms fro the TIM2 ISR.  Both the TIM2 callback (starting the ADC) and the ADC ConversionComplete callback contain each their own "visit counter"  tim_convs++ and adc_convs++;
And irrespective of what I configure in the CubeIDE ADC-setup, both values always rise in parallel!
So End of Single conversion (once per channel one would expect) and End of Conversiopn group (once per channel group) behave exactly identical. 
=> in DMA mode  ADC End-of-Single-conversion  (one Interrupt, more precise one callback call per conversion) does not exists, behaviour is always "callback at End-of-Conversion-Group."