AT32F421
Series Reference Manual
2022.11.11
Page 311
Rev 2.02
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
18.4.3.3 Repetition mode
The repetition mode is enabled by setting the RPEN bit in the ADC_CTRL2 register. When a trigger
signal is detected, the ordinary channels will be converted repeatedly. This mode can work with the
ordinary group conversion in the sequence mode so as to enable the repeated conversion of the ordinary
group. Such mode can also work with the preempted group auto conversion mode so as to repeatedly
convert the ordinary group and preempted group in sequence. Figure 18-6 shows an example of the
behavior when the repetition mode works with the sequence mode and preempted group auto
conversion mode.
Figure 18-6
Repetition mode
ADC_IN5
ADC_IN0
OCLEN=1, OSN1=ADC_IN5, OSN2=ADC_IN0
Ordinary channel
trigger
CCE flag set
PCLEN=1, PSN3=ADC_IN14, PSN4=ADC_IN1
ADC_IN14
ADC_IN1
CCE and
PCCE flag set
ADC_IN5
ADC_IN0
CCE flag set
ADC_IN14
Sampling
Conversion
18.4.3.4 Partition mode
The partition mode of the ordinary group can be enabled by setting the OCPEN bit in the ADC_CTRL1
register. In this mode, the ordinary group conversion sequence length (OCLEN bit in the ADC_OSQ1
register) is divided into a smaller sub-group, in which the number of the channels is programmed with
the OCPCNT bit in the ADC_CTRL1 register. A single trigger event will enable the conversion of all the
channels in the sub-group. Each trigger event selects different sub-group in order.
Set the PCPEN bit in the ADC_CTRL1 register will enable the partition mode of the preempted group.
In this mode, the conversion sequence length (PCLEN bit in the ADC_PSQ1 register) is divided into a
sub-group with only one channel. A single one trigger event will enable the conversion of the channel in
the sub-group. Each trigger event selects different sub-group in order.
The partition mode cannot be used with the repetition mode at the same time.
shows an
example of the behavior in partition mode for ordinary group and preempted group.