2024-06-27 1:21 AM
I understand that ADC Linear Calibration is performed during device production and the values stored in the System Memory.
However, I have been unable to find any documentation on where the 6 values are stored.
Also, are their 6 values per ADC device (ADC1, ADC2, ADC3) or do one set of values apply to all 3 ADCs?
Solved! Go to Solution.
2024-07-04 11:52 PM
In case anyone else is looking for this information (STM32H745), which apparently is not documented, this is the reply from ST Customer Support:
Subject: ADC Linear Calibration Address
Description:
Hello,
indeed, it's not documented.
ADC1:0x1FF1 EC00 - 0x1FF1 EC14
ADC2:0x1FF1 EC20 - 0x1FF1 EC34
ADC3:0x1FF1 EC40 - 0x1FF1 EC54
However, even linear calibration is technology depended we highly recommend to perform user calibration instead of use factory data to reach better adc performance.
BR, Jan
2024-06-28 6:43 AM
This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.
2024-06-28 7:30 AM - edited 2024-06-28 7:53 AM
Hi,
its more : you have to call calibration... ->
HAL_ADCEx_Calibration_Start (..)
see text there )in xxx_hal_adc_ex.c :
**
* @brief Perform an ADC automatic self-calibration
* Calibration prerequisite: ADC must be disabled (execute this
* function before HAL_ADC_Start() or after HAL_ADC_Stop() ).
* @PAram hadc ADC handle
* @PAram CalibrationMode Selection of calibration offset or
* linear calibration offset.
* @arg ADC_CALIB_OFFSET Channel in mode calibration offset
* @arg ADC_CALIB_OFFSET_LINEARITY Channel in mode linear calibration offset
* @PAram SingleDiff Selection of single-ended or differential input
* This parameter can be one of the following values:
* @arg @ref ADC_SINGLE_ENDED Channel in mode input single ended
* @arg @ref ADC_DIFFERENTIAL_ENDED Channel in mode input differential ended
* @retval HAL status
or/and load factory calib:
/**
* @brief Load the calibration factor from engi bytes
* @PAram hadc ADC handle
* @retval HAL state
*/
HAL_StatusTypeDef HAL_ADCEx_LinearCalibration_FactorLoad(ADC_HandleTypeDef *hadc)
{
HAL_StatusTypeDef tmp_hal_status = HAL_OK;
uint32_t cnt, FactorOffset;
uint32_t LinearCalib_Buffer[ADC_LINEAR_CALIB_REG_COUNT];
/* Linearity calibration is retrieved from engi bytes
read values from registers and put them to the CALFACT2 register */
/* If needed linearity calibration can be done in runtime using
LL_ADC_GetCalibrationLinearFactor() */
...Just : I always use ..calibration_start , doing calibration now. This some ms i can spend at program start...
see ds (note):
I never tried just loading calibration factors...but you can try and compare, whats better.
I bet, doing actual calibration (lin and diff) is better, because at actual temp and age of chip.
2024-07-04 11:52 PM
In case anyone else is looking for this information (STM32H745), which apparently is not documented, this is the reply from ST Customer Support:
Subject: ADC Linear Calibration Address
Description:
Hello,
indeed, it's not documented.
ADC1:0x1FF1 EC00 - 0x1FF1 EC14
ADC2:0x1FF1 EC20 - 0x1FF1 EC34
ADC3:0x1FF1 EC40 - 0x1FF1 EC54
However, even linear calibration is technology depended we highly recommend to perform user calibration instead of use factory data to reach better adc performance.
BR, Jan
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.