
Analog-to-digital converters (ADC)
RM0351
528/1830
DocID024597 Rev 5
–
...
•
DISCEN=0, channels to be converted = 1, 2, 3, 6, 7, 8, 9, 10,11
–
1st trigger: the complete sequence is converted: channel 1, then 2, 3, 6, 7, 8, 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.
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 ADC_CFGR register. It converts the
sequence selected in the ADC_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
ADC_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 ADC_JSQR register.
Example:
•
JDISCEN=1, channels to be converted = 1, 2, 3
–
1st trigger: channel 1 converted (a JEOC event is generated)
–
2nd trigger: channel 2 converted (a JEOC event is generated)
–
3rd trigger: channel 3 converted and a JEOC event + a JEOS event are generated
–
...
Note:
When all injected channels have been converted, the next trigger starts the conversion of
the first injected channel. In the example above, the 4th trigger reconverts the 1st injected
channel 1.
It is not possible to use both auto-injected mode and discontinuous mode simultaneously:
the bits DISCEN and JDISCEN must be kept cleared by software when JAUTO is set.
18.4.21 Queue of context for injected conversions
A queue of context is implemented to anticipate up to 2 contexts for the next injected
sequence of conversions. JQDIS bit of ADC_CFGR register must be reset to enable this
feature. Only hardware-triggered conversions are possible when the context queue is
enabled.
This context consists of:
•
Configuration of the injected triggers (bits JEXTEN[1:0] and JEXTSEL[3:0] in
ADC_JSQR register)
•
Definition of the injected sequence (bits JSQx[4:0] and JL[1:0] in ADC_JSQR register)