2020-04-16 03:15 AM
Hello,
I'm trying to use temperature sensor and the internal voltage reference (VREFINT) of the STM32f042k6.
Here is the extract form the datasheet (page 19/117) :
When I measure these values, I don't have the same values than ST.
For example, let's watch the internal voltage reference :
The difference is too high and I can't use theses data. Maybe the problem come from a bad configuration ?
If I set the STM32 voltage to 3.2 V, it is more accurate, but, in ST datasheet, the calbiration was done with 3.3V...
My hardware :
Thanks for reading,
Best regards,
Valentin
Solved! Go to Solution.
2020-04-16 07:48 AM
Did you calibrate the ADC before use?
2020-04-16 07:48 AM
Did you calibrate the ADC before use?
2020-04-16 01:38 PM
Hello Uwe Bonnes,
You were right, I thought the ADC calibration was done when initializing the ADC with HAL library, but we need to calibrate with the following code
HAL_ADCEx_Calibration_Start(&hadc);
Thank you for your help,
Best regards,
Valentin
2020-04-16 09:59 PM
Do not ever assume that any HAL function does what you think it should do.