
AT32F413
Series Reference Manual
2022.06.27
Page 270
Rev 2.00
19.4 ADC functional overview
19.4.1 Channel management
Analog signal channel input:
There are 18 analog signal channel inputs for each of the ADCs, expressed by ADC_Inx (x=0 to 17).
ADC1_IN0 to ADC1_IN15 are referred to as the external analog input, ADC1_IN16 as the internal
temperature sensor, and ADC1_IN17 as the internal reference voltage.
ADC2_IN0 to ADC2_IN15 are referred to as the external analog input, and ADC2_IN16 and
ADC2_IN17 as Vss
Channel conversion
The conversions are divided into two groups: ordinary and preempted ones. The preempted group has
priority over the ordinary group.
If the preempted channel trigger occurs during the ordinary channel conversion, then the ordinary
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 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.
19.4.1.1 Internal temperature sensor
The temperature sensor is connected to ADC1_IN16. Before the temperature sensor channel conversion,
it is required to enable the ITSRVEN bit in the ADC_CTRL2 register and wait after power-on time.
Obtain the temperature using the following formula:
Temperature (in °C) = {(V 25 - V
SE N S E
) / Avg_Slope} + 25.
Where,
V
2 5
= V
S E NS E
value for 25° C and
Avg_Slope =
Average Slope for curve between Temperature vs. V
S E N S E
(given in mV/° C).
19.4.1.2 Internal reference voltage
The internal reference voltage of the typical value 1.2 V is connected to ADC1_IN17. It is required 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.