
AT32F413
Series Reference Manual
2022.06.27
Page 271
Rev 2.00
19.4.2 ADC operation process
shows the basic operation process of the ADC. It is recommended to do the calibration
after the initial power-on in order to improve the accuracy of sampling and conversion. After the
completion of calibration, trigger is used to start ADC sampling conversion. Read data at the end of the
conversion.
Figure 19-2
ADC basic operation process
Power-on
Calibration
Trigger
ADC
conversion
Read data
19.4.2.1 Power-on and calibration
Power-on
Set the ADCxEN bit in the CRM_APB2EN register to enable ADC clocks: PCLK2 and ADCCLK.
Program the desired ADCCLK frequency by setting the ADCDIV bit in the CRM_CFG register. The
ADCCLK is derived from PCLK2 frequency division.
Note: ADCCLK must be less than 28 MHz.
Then set the ADCEN bit in the ADC_CTRL2 register to supply the ADC, and wait until the t
STAB
is reached
before subsequent operations. Clear the ADCEN bit will stop the ADC conversion and result in a reset.
In the meantime, the ADC is switched off to save power.
Calibration
After power-on, the calibration is enabled by setting the ADCAL bit in the ADC_CTRL2 register. When
the calibration is over, the ADCAL bit is cleared by hardware and the conversion is performed by software
trigger.
After each calibration, the calibration value is stored in the ADC_ODT register, and then value is
automatically sent back to the ADC so as to eliminate capacitance errors. The storage of the calibration
value will not set the CCE flag, or generate interrupts or DMA requests.