RM0432
The internal analog calibration is lost each time the power of the ADC is removed (example,
when the product enters in STANDBY or VBAT mode). In this case, to avoid spending time
recalibrating the ADC, it is possible to re-write the calibration factor into the ADC_CALFACT
register without recalibrating, supposing that the software has previously saved the
calibration factor delivered during the previous calibration.
The calibration factor can be written if the ADC is enabled but not converting (ADEN=1 and
ADSTART=0 and JADSTART=0). Then, at the next start of conversion, the calibration factor
will automatically be injected into the analog ADC. This loading is transparent and does not
add any cycle latency to the start of the conversion. It is recommended to recalibrate when
V
voltage changed more than 10%.
REF+
Software procedure to calibrate the ADC
1.
Ensure DEEPPWD=0, ADVREGEN=1 and that ADC voltage regulator startup time has
elapsed.
2.
Ensure that ADEN=0.
3.
Select the input mode for this calibration by setting ADCALDIF=0 (single-ended input)
or ADCALDIF=1 (differential input).
4.
Set ADCAL=1.
5.
Wait until ADCAL=0.
6.
The calibration factor can be read from ADC_CALFACT register.
ADCALDIF
ADC State
CALFACT_x[6:0]
Software procedure to re-inject a calibration factor into the ADC
1.
Ensure ADEN=1 and ADSTART=0 and JADSTART=0 (ADC enabled and no
conversion is ongoing).
2.
Write CALFACT_S and CALFACT_D with the new calibration factors.
3.
When a conversion is launched, the calibration factor will be injected into the analog
ADC only if the internal analog calibration factor differs from the one stored in bits
CALFACT_S for single-ended input channel or bits CALFACT_D for differential input
channel.
0: Single-ended input
ADCAL
OFF
Startup
by S/W
by H/W
Figure 92. ADC calibration
1: Differential input
t
CAB
Calibrate
0x00
Indicative timings
RM0432 Rev 6
Analog-to-digital converters (ADC)
Calibration factor
OFF
MSv30263V2
623/2301
724
Need help?
Do you have a question about the STM32L4+ Series and is the answer not in the manual?