AnsweredAssumed Answered

STM32L0 ADC two channel polling

Question asked by Haekoth on Nov 6, 2016
Latest reply on Nov 9, 2016 by Haekoth
Hi, 

I am coding an application for STM32L053R8 using the HAL functions. Right now I need to read continuously two analog values via ADC. Because there is no need of high frequency readings, I want to try doing it via polling instead of using the DMA right away.

The problem is I don't know how to differentiate from which channel the value at the ADC data register comes from. Because I've set the EOCSelection to Single Conversion, my idea was to assign the value to one channel when only EOC is active and assign it to the other one when both EOC and EOS are active, depending on each channel's rank on the regular group. However, the HAL's function PollForConversion clears both EOC and EOS, so I have no way of knowing their value when the data is avalaible. 

If I was using STM32F4, I would just use the Injected Channel sequence, but I believe (please correct me if I'm wrong) they are not available in STM32L0. 

Any ideas on how to do this? 

Thank you very much.

Outcomes