RM0046 Analog-to-Digital Converter (ADC)
Doc ID 16912 Rev 5 579/936
Injected channel conversion
A conversion chain can be injected into the ongoing normal conversion by configuring the
Injected Conversion Mask Registers (JCMR). As with normal conversion, each channel can
be selected individually. This injected conversion (which can occur only in One Shot mode)
interrupts the normal conversion (which can be in One Shot or Scan mode). When an
injected conversion is inserted, ongoing normal channel conversion is aborted and the
injected channel request is processed. After the last channel in the injected chain is
converted, normal conversion resumes from the channel at which the normal conversion
was aborted, as shown in Figure 281.
Figure 281. Injected sample/conversion sequence
The injected conversion can be started using two options:
● By software setting the MCR[JSTART]; the current conversion is suspended and the
injected chain is converted. At the end of the chain, the JSTART bit in the MSR is reset
and the normal chain conversion is resumed.
● By an internal trigger signal from the PIT when MCR[JTRGEN] is set; a programmed
event (rising/falling edge depending on MCR[JEDGE]) on the signal coming from PIT or
CTU starts the injected conversion by setting the MSR[JSTART]. At the end of the
chain, the MSR[JSTART] is cleared and the normal conversion chain is resumed.
The MSR[JSTART] is automatically set when the Injected conversion starts. At the same
time the MCR[JSTART] is reset, allowing the software to program a new start of conversion.
In that case the new requested conversion starts after the running injected conversion is
completed.
At the end of each injected conversion, an End Of Injected Conversion (JEOC) interrupt is
issued (if enabled by the IMR[MSKJEOC]) and at the end of the sequence an End Of
Injected Chain (JECH) interrupt is issued (if enabled by the IMR[MSKJEOC]).
If the content of all the injected conversion mask registers (JCMR) is zero (that is, no
channel is selected) the JECH interrupt is immediately issued after the start of conversion.
Once started, injected chain conversion cannot be interrupted by any other conversion type
(it can, however, be aborted; see Section , Abort conversion).
The ongoing channel conversion is interrupted and the injected
conversion chain is processed first. After the injected chain is
converted the normal chain conversion resumes from the channel at
which normal conversion was aborted.
Injected conversion of channels I and J
Normal conversion resumes from
the last aborted channel.
Sample B Convert B Sample C Sample D Convert D Sample E Convert EConvert C
Sample C Abort C Sample I Sample J Convert J Sample C Convert CConvert I