AT32F425
Series Reference Manual
2022.03.30
Page 304
Ver 2.01
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 channel conversion in the sequence mode to enable the repeated conversion of the ordinary
group. Such mode can also work with the preempted group auto conversion mode to repeatedly convert
the ordinary group and preempted group in sequence. Figure 19-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 preempted group conversion sequence length (OCLEN bit in the ADC_OSQ1 register)
is divided into a sub-group with only one channel. A single one trigger event will enable the conversion
of all the channels 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.
example of the behavior in partition mode for ordinary group and preempted group.
Figure 18-7
Partition mode
ADC_IN5
ADC_IN0
OCLEN=4, OCPCNT=1, OSN1=ADC_IN5, OSN2=ADC_IN0, OSN3=ADC_IN2, OSN4=ADC_IN1, OSN5=ADC_IN7
Ordinary channel
trigger
CCE flag set
PCLEN=2, PSN2=ADC_IN14, PSN3=ADC_IN1, PSN4=ADC_IN13
ADC_IN2
ADC_IN1
ADC_IN7
Ordinary channel
trigger
CCE flag set
ADC_IN5
Ordinary channel
trigger
ADC_IN14
ADC_IN1
Preempted
channel trigger
PCCE flag set
ADC_IN13
ADC_IN14
Preempted
channel trigger
Preempted
channel trigger
Preempted
channel trigger
CCE flag set
Ordinary channel
trigger
ADC_IN0
CCE flag set
Sampling
Conversion
18.4.4 Oversampling
A single oversampling converted data can be done through multiple conversions of the same channel in
which the cumulative converted data is averaged.
Oversampling ratio is selected through the OSRSEL bit in the ADC_OVSP register. This bit is used
to specify the oversampling multiple, which is performed by converting the same channel several
times