Skip to main content
Anton_Huang
Associate II
October 7, 2025
Question

Question about ADC Calibration using HAL_ADCEx_Calibration_Start()

  • October 7, 2025
  • 2 replies
  • 268 views

MCU:STM32G070CBTx LQFP48

My question is as follows: 
Why is it necessary to execute HAL_ADCEx_Calibration_Start() to calibrate EO and EG before using the ADC?
Why isn’t this calibration performed at the factory before shipment?

2 replies

Ozone
Principal
October 7, 2025

> Why isn’t this calibration performed at the factory before shipment?

It is, in fact.

But since an ADC involves several analogue components suspectible to temperature, a calibration is highly recommended before every usage.

Detail are usually found in the datasheet and reference manual of the specific MCU.

Anton_Huang
Associate II
October 7, 2025

If my operating temperature range is from -40°C to 80°C, do I need to run HAL_ADCEx_Calibration_Start() once according to the current temperature?

Ozone
Principal
October 7, 2025

That depends on your requirements and the operating conditions.

The stated range of -40°C to 80°C is the ambient temperature, which only applies when the device was turned off long enough to be at thermal equilibrum. Since the device is most probably enclosed in a casing with little or no ventilation, it will heat up until a new equilibrum is reached. This was (and is) a problem especially with oscillators for radio transmitters were minimum frequency drift is required. Those devices often control the temperature of teh oscillator circuit in a range of a few °C.

What your application requires depends on your needs.
I would suggest run some tests at the required temperature range, record offsets and required calibration values, and decide on a strategy, i.e. if you need recalibration, and how often.

By the way, the "default" assumption for an electronic device to reach thermal equilibrum is about 15 minutes. We talk about minutes here, not milliseconds or seconds.

Anton_Huang
Associate II
October 7, 2025

May I ask what reference values are used by the HAL_ADCEx_Calibration_Start() function during calibration?
Are they based on the voltages at the VSSA and VREF+ pins?