41.5.2 Channel Sequencer
1
), and the
scan sequence is executed when the GO bit is set by software or by the reception of an auto-conversion
trigger.The sequence includes all channel contexts that are enabled via the context’s Channel
Scan Enable (CHEN) bit. A context channel is included in the scan sequence
when the CHEN bit is set (CHEN = 1
). If all context channels’ CHEN bits
are clear (CHEN = 0
), the GO bit is immediately cleared and no
conversions or interrupts will occur.
A sequence always begins with Context 1, as long as its CHEN bit is enabled. If Context
1’s CONT bit is set (CONT = 1
), the sequencer will
scan Context 1 and continue scanning until the threshold test invokes the ADC Channel
Threshold Interrupt Flag (ADCHnIF). If the ADC Stop On Interrupt (SOI) bit is set (SOI = 1
) and the channel threshold
interrupt occurs, the scanner will proceed to check Context 1’s ADC Scan Stop On
Interrupt (SSI) bit to determine whether to proceed to the next channel
context. If SSI is set (SSI = 1
), the scanner will clear the GO bit and
the scanner will stop. If the SSI bit is clear (SSI = 0
), the scanner
proceeds to the next channel context that has the CHEN bit set.
If Context 1’s CONT bit is set, the SOI bit is clear (SOI = 0
) and the
scanner will repeatedly scan Context 1 until software clears the GO bit.
If Context 1’s CONT bit is clear (CONT = 0
), the sequencer will scan
Context 1, and when the conversion completes, the channel threshold test is performed.
If ADCHnIF is set, the sequencer checks Context 1’s SSI bit to determine whether to
proceed to the next channel context. If SSI is set, the sequencer clears GO and the
scanner stops. If the SSI bit is clear, the sequencer will proceed to the next channel
that has the CHEN bit set.
The scan sequence ends when any context’s channel threshold interrupt occurs and that context’s SSI bit is set. If the sequencer has scanned all enabled channels and no interrupt occurs, or no context’s SSI bit is set, the sequencer will return to Context 1 (or the first enabled channel context) and repeat the scanning process until software clears the GO bit.
111
) and set the SSI bit. These settings allow the scanner to stop
after the scan sequence has completed.The figure below illustrates the operation of the channel sequencer.