2020-07-30 04:22 AM
AN2834 Rev 4, point 4.2.9 Temperature-effect compensation says:
One method is be to fully characterize the offset and gain drift and provide a lookup table in memory to correct measurement according to temperature change. This calibration involves additional cost and takes time.
The second method consists in recalibrating the ADC when the temperature change reaches given values, by using the internal temperature sensor and the ADC watchdog.
A quick web search turns up the following API:
HAL_ADCEx_Calibration_Start (ADC_HandleTypeDef *hadc, uint32_t SingleDiff)
Perform an ADC automatic self-calibration Calibration
However I can't find this API in the HAL-LL drivers that came with STM32CubeF4 Firmware Package V1.25.0. Is this API available on F4 machines? If not, is there a similarly straight-forward API or method to perform automated calibration of the internal ADCs on F4 machines?
Solved! Go to Solution.
2020-07-30 05:36 AM
> Is this API available on F4 machines? If not, is there a similarly straight-forward API or method to perform automated calibration of the internal ADCs on F4 machines?
No and No. You need to implement your calibration manually. Note that the ADC is relatively accurate off the bat, see datasheet for details.
2020-07-30 05:36 AM
> Is this API available on F4 machines? If not, is there a similarly straight-forward API or method to perform automated calibration of the internal ADCs on F4 machines?
No and No. You need to implement your calibration manually. Note that the ADC is relatively accurate off the bat, see datasheet for details.
2020-07-31 07:30 AM
There are at least two distinct ADC designs in the various STM32 families - the design in 'F4 does not have any inherent calibration mechanism, the other design e.g. in 'L4 has.
Look at the ADC chapter in your STM32's family RM, if there's an ADC_CALFACT register, you have to perform calibration (there's a related ADCAL bit in ADC_CR), otherwise you don't.
JW