Skip to main content
GVG
Associate II
February 23, 2023
Question

What is the difference between ADC_CALIB_OFFSET and ADC_CALIB_OFFSET_LINEARITY (STM32H7 HAL ADC) ?

  • February 23, 2023
  • 2 replies
  • 2879 views

In the STM32 H7 HAL driver (UM2217) there is the following function:

0693W00000aHYEtQAO.jpgIt is absolutely not clear for me that what is the difference between ADC_CALIB_OFFSET and ADC_CALIB_OFFSET_LINEARITY?

Thank you in advance

This topic has been closed for replies.

2 replies

raptorhal2
Lead
February 24, 2023

ADC_CALIB_OFFSET corrects the ADC for bias at zero volts input.

ADC_CALIB_OFFSET_LINEARITY corrects the ADC gain over the input voltage range.

From what I can gather from the H750 reference manual, your choices are offset only or offset plus linearity calibration.

Cheers, Hal

GVG
GVGAuthor
Associate II
February 24, 2023

However, if ADC_CALIB_OFFSET only corrects your offset error but ADC_CALIB_OFFSET_LINEARITY corrects both your offset + gain error, then why do you have these two choices? I mean, you could simply just use ADC_CALIB_OFFSET_LINEARITY option all the time and it corrects everything.