Analog-to-digital converters (ADC)
RM0365
311/1080
DocID025202 Rev 7
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.
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.
15.3.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.
This context consists of:
•
Configuration of the injected triggers (bits JEXTEN[1:0] and JEXTSEL[3:0] in
ADCx_JSQR register)
•
Definition of the injected sequence (bits JSQx[4:0] and JL[1:0] in ADCx_JSQR register)