Analog-to-digital converters (ADC)
12.3.20
Discontinuous mode (DISCEN, DISCNUM, JDISCEN)
Regular group mode
This mode is enabled by setting the DISCEN bit in the ADCx_CFGR register.
It is used to convert a short sequence (sub-group) of n conversions (n ≤ 8) that is part of the
sequence of conversions selected in the ADCx_SQR registers. The value of n is specified
by writing to the DISCNUM[2:0] bits in the ADCx_CFGR register.
When an external trigger occurs, it starts the next n conversions selected in the ADCx_SQR
registers until all the conversions in the sequence are done. The total sequence length is
defined by the L[3:0] bits in the ADCx_SQR1 register.
Example:
•
DISCEN=1, n=3, channels to be converted = 1, 2, 3, 6, 7, 8, 9, 10, 11
–
–
–
–
–
•
DISCEN=0, channels to be converted = 1, 2, 3, 6, 7, 8, 9, 10,11
–
–
Note:
When a regular group is converted in discontinuous mode, no rollover occurs (the last
subgroup of the sequence can have less than n conversions).
When all subgroups are converted, the next trigger starts the conversion of the first
subgroup. In the example above, the 4th trigger reconverts the channels 1, 2 and 3 in the
1st subgroup.
It is not possible to have both discontinuous mode and continuous mode enabled. In this
case (if DISCEN=1, CONT=1), the ADC behaves as if continuous mode was disabled.
Injected group mode
This mode is enabled by setting the JDISCEN bit in the ADCx_CFGR register. It converts
the sequence selected in the ADCx_JSQR register, channel by channel, after an external
injected trigger event. This is equivalent to discontinuous mode for regular channels where
'n' is fixed to 1.
When an external trigger occurs, it starts the next channel conversions selected in the
ADCx_JSQR registers until all the conversions in the sequence are done. The total
sequence length is defined by the JL[1:0] bits in the ADCx_JSQR register.
214/874
1st trigger: channels converted are 1, 2, 3 (an EOC event is generated at each
conversion).
2nd trigger: channels converted are 6, 7, 8 (an EOC event is generated at each
conversion).
3rd trigger: channels converted are 9, 10, 11 (an EOC event is generated at each
conversion) and an EOS event is generated after the conversion of channel 11.
4th trigger: channels converted are 1, 2, 3 (an EOC event is generated at each
conversion).
...
1st trigger: the complete sequence is converted: channel 1, then 2, 3, 6, 7, 9, 10
and 11. Each conversion generates an EOC event and the last one also generates
an EOS event.
all the next trigger events will relaunch the complete sequence.
RM0366 Rev 5
RM0366
Need help?
Do you have a question about the STM32F301 6 Series and is the answer not in the manual?