cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L031C6 reading vdda & temperature

Ufoit
Visitor

Hi,
I have a custom board with an STM32L031C6 and I'm trying to read the internal temperature. The board is battery powered at about 2.6V and the vdda is the same.
If I read the ADC channel with vrefint, it returns a value of about 850, which, when passed to the function __LL_ADC_CALC_VREFANALOG_VOLTAGE(adcVal[4], LL_ADC_RESOLUTION_12B), returns a calculated VDDA of 6V, which is obviously incorrect.
Using this vref to calculate the internal temperature obviously results in a value that's out of range.
The same thing works correctly on a NUCLEO-C031.
What am I doing wrong?

Thanks!

0 REPLIES 0