AT32F421
Series Reference Manual
2022.11.11
Page 308
Rev 2.02
channel conversion is interrupted, giving the priority to the preempted channel, and the ordinary channel
continues its conversion at the end of the preempted channel conversion. If the ordinary channel trigger
occurs during the preempted channel conversion, the ordinary channel conversion won’t start until the
end of the preempted channel conversion.
Program the channel (ADC_Inx) into the ordinary channel sequence (ADC_OSQx) and the preempted
channel sequence (ADC_PSQ), and the same channel can be repeated, the total number of sequences
is determined by OCLEN and PCLEN, then it is ready to enable the ordinary channel or preempted
channel conversion.
18.4.1.1 Internal temperature sensor
The temperature sensor is connected to ADC1_IN16. Before the temperature sensor channel
conversion, it is mandatory to enable the ITSRVEN bit in the ADC_CTRL2 register and wait after power-
on time.
The converted data of such channel, along with the voltage value at 25°C and Avg_Slope ,can be
used to calculate the temperature.
18.4.1.2 Internal reference voltage
The internal reference voltage of the typical value 1.2 V is connected to ADC1_IN17. It is mandatory to
enable the ITSRVEN bit in the ADC_CTRL2 register before the internal reference channel conversion.
The converted data of such channel can be used to calculate the external reference voltage.
18.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
calibration, trigger is used to enable ADC sampling and conversion. Read data at the end of the
conversion.
Figure 18-2 ADC basic operation process
Power-on
Calibration
Trigger
ADC
conversion
Read data
18.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 power the ADC, and wait until the t
S T AB
is ready
before starting ADC conversion. Clear the ADCEN bit will halt the ADC conversion and result in a reset.
In the meantime, the ADC can be switched off to save power.