cancel
Showing results for 
Search instead for 
Did you mean: 

Question about ADC Calibration using HAL_ADCEx_Calibration_Start()

Anton_Huang
Associate II

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?

5 REPLIES 5
Ozone
Principal II

> 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

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?

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.

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?

> Are they based on the voltages at the VSSA and VREF+ pins?

To be honest, I don't know.
As with most STM32 devices, ADC calibration boils down to triggering an in-built self-calibration. Which values it uses the reference manual does not reveal.
And I am not a ST employee, so I have no special insight. But supply/reference voltage and perhaps die temperature might be a good guess.

By the way, although the mentiond Cube function HAL_ADCEx_Calibration_Start() implements the calibration, I would nonetheless recommend to study the respective reference manual section (14 / 14.3.3) for a better understanding.