AT32F425
Series Reference Manual
2022.03.30
Page 303
Ver 2.01
18.4.3 Conversion sequence management
Only one channel is converted at each trigger event by default, that is, OSN1-defined channel or PSN4-
defined channel.
The detailed conversion sequence modes are described in the following sections. With this, the channels
can be converted in a specific order.
18.4.3.1 Sequence mode
The sequence mode is enabled by setting the SQEN bit in the ADC_CTRL1 register. The ADC_OSQx
registers are used to configure the sequence and total number of the ordinary channels while the
ADC_PSQ register is used to define the sequence and total number of the preempted channels. When
the sequence mode is enabled, a single trigger event enables the conversion of a group of channels in
order. The ordinary channels start converting from the QSN1 while the preempted channels starts from
the PSNx, where x=4-PCLEN. Figure 18-4 shows an example of the behavior in sequence mode.
Figure 18-4
Sequence mode
ADC_IN5
ADC_IN0
ADC_IN5
OCLEN=2, OSN1=ADC_IN5, OSN2=ADC_IN0, OSN3=ADC_IN5
Ordinary channel
trigger
CCE flag set
ADC_IN5
ADC_IN0
ADC_IN5
CCE flag set
Ordinary channel
trigger
ADC_IN14
ADC_IN1
ADC_IN14
PCLEN=2, PSN2=ADC_IN14, PSN3=ADC_IN1, PSN4=ADC_IN14
Preempted channel
trigger
CCE and
PCCE flag set
ADC_IN14
ADC_IN1
ADC_IN14
CCE and
PCCE flag set
Preempted channel
trigger
Sampling
Conversion
18.4.3.2 Automatic preempted group conversion mode
The automatic preempted group conversion mode is enabled by setting the PCAUTOEN bit in the
ADC_CTRL1 register. Once the ordinary channel conversion is over, the preempted group will
automatically continue its conversion. This mode can work with the sequence mode. The preempted
group conversion starts automatically at the end of the conversion of the ordinary group.
shows an example of the behavior when the automatic preempted group conversion mode works with
the ordinary group.
Figure 18-5
Preempted group auto conversion mode
ADC_IN5
ADC_IN0
ADC_IN5
OCLEN=2, OSN1=ADC_IN5, OSN2=ADC_IN0, OSN3=ADC_IN5
Ordinary channel
trigger
CCE flag set
PCLEN=1, PSN3=ADC_IN14, PSN4=ADC_IN1
ADC_IN14
ADC_IN1
CCE and
PCCE flag set
Sampling
Conversion