Analog-to-digital converters (ADC)
12.3.8
Calibration (ADCAL, ADCALDIF, ADCx_CALFACT)
Each ADC provides an automatic calibration procedure which drives all the calibration
sequence including the power-on/off sequence of the ADC. During the procedure, the ADC
calculates a calibration factor which is 7-bit wide and which is applied internally to the ADC
until the next ADC power-off. During the calibration procedure, the application must not use
the ADC and must wait until calibration is complete.
Calibration is preliminary to any ADC operation. It removes the offset error which may vary
from chip to chip due to process or bandgap variation.
The calibration factor to be applied for single-ended input conversions is different from the
factor to be applied for differential input conversions:
•
Write ADCALDIF=0 before launching a calibration which will be applied for single-
ended input conversions.
•
Write ADCALDIF=1 before launching a calibration which will be applied for differential
input conversions.
The calibration is then initiated by software by setting bit ADCAL=1. Calibration can only be
initiated when the ADC is disabled (when ADEN=0). ADCAL bit stays at 1 during all the
calibration sequence. It is then cleared by hardware as soon the calibration completes. At
this time, the associated calibration factor is stored internally in the analog ADC and also in
the bits CALFACT_S[6:0] or CALFACT_D[6:0] of ADCx_CALFACT register (depending on
single-ended or differential input calibration)
The internal analog calibration is kept if the ADC is disabled (ADEN=0). However, if the ADC
is disabled for extended periods, then it is recommended that a new calibration cycle is run
before re-enabling the ADC.
The internal analog calibration is kept if the ADC is disabled (ADEN=0). When the ADC
operating conditions change (V
variations, V
calibration cycle.
The internal analog calibration is lost each time the power of the ADC is removed (example,
when the product enters in STANDBY or V
recalibrating the ADC, it is possible to re-write the calibration factor into the
ADCx_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.
Software procedure to calibrate the ADC
1.
Ensure ADVREGEN[1:0]=01 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 ADCx_CALFACT register.
200/874
REF+
and temperature change to a lesser extent), it is recommended to re-run a
DDA
RM0366 Rev 5
changes are the main contributor to ADC offset
mode). In this case, to avoid spending time
BAT
RM0366
Need help?
Do you have a question about the STM32F301 6 Series and is the answer not in the manual?