cancel
Showing results for 
Search instead for 
Did you mean: 

Strange ST factory calibration on STM32f042k6 (ADC)

ValentinG
Associate II

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) :

0693W000000VvHzQAK.png

When I measure these values, I don't have the same values than ST.

For example, let's watch the internal voltage reference :

  • VREFINT_CAL (factory calibration) is 1529 (12 bits ADC value)
  • if I measure it myself with the DAC, I get 1470 (12 bits ADC value).

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 :

  • only one power supply for Vdd and Vdda : 3.29 V (checked with multimeter)
  • temperature : 18°C
  • ADC config : 12 bits, max sampling time (239.5 cycles)
  • STM32 frequency : 48Mhz
  • I'm using HAL library

Thanks for reading,

Best regards,

Valentin

1 ACCEPTED SOLUTION

Accepted Solutions
Uwe Bonnes
Principal III

Did you calibrate the ADC before use?

View solution in original post

3 REPLIES 3
Uwe Bonnes
Principal III

Did you calibrate the ADC before use?

ValentinG
Associate II

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

Do not ever assume that any HAL function does what you think it should do.