AnsweredAssumed Answered

Need help reading BOTH temperature and reference voltage

Question asked by Jim Seymour on May 20, 2016
Latest reply on May 20, 2016 by FTITI.Walid
Using Cube-generated code...

I'm a little confused about the HAL_ADC functions to read the temperature and reference voltage channels.  I can read the temperature with this simple code:

HAL_ADC_Start(&hadc);
HAL_ADC_PollForConversion(&hadc, 10);
cpuTemp = HAL_ADC_GetValue(&hadc);

However, it's not clear to me how to read the reference voltage, as well.  The same "hadc" handle is set up to read both channels.  Is it as simple as calling _PollForConversion again?  Or do I need to actually set up a DMA operation with a 2-field buffer.

If anybody has some sample code that does this, I'd really appreciate it.

Thanks!

Outcomes