Skip to main content
ValentinG
Associate II
April 16, 2020
Solved

Strange ST factory calibration on STM32f042k6 (ADC)

  • April 16, 2020
  • 2 replies
  • 1939 views

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

This topic has been closed for replies.
Best answer by Uwe Bonnes

Did you calibrate the ADC before use?

2 replies

Uwe Bonnes
Uwe BonnesBest answer
Chief
April 16, 2020

Did you calibrate the ADC before use?

ValentinG
ValentinGAuthor
Associate II
April 16, 2020

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

berendi
Principal
April 17, 2020

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