Single Intermittent Mode Conversion; Trigger Injection; Auto-Injection - WCH CH32V003 Series Reference Manual

Table of Contents

Advertisement

CH32V003 Reference Manual
same group is converted automatically when the current channel conversion is finished.
In the scan mode, there is a subdivision into triggered injection mode and automatic injection mode depending
on the status of the IAUTO bit.
l

Trigger injection

IAUTO bit is 0. When the trigger event of injection group channel conversion occurs during the scanning of
rule group channels, the current conversion is reset and the sequence of injection channels is performed in a
single scan, and the last interrupted rule group channel conversion is resumed after all selected injection group
channel scanning conversions are completed.
If a rule channel start event occurs while the injection group channel sequence is currently being scanned, the
injection group conversion is not interrupted, but the rule sequence conversion is executed again after the
injection sequence conversion is completed.
Note: When using triggered injection conversions, you must ensure that the interval between triggered events
is longer than the injection sequence. For example, if the overall time to complete the conversion of the
injection sequence takes 28 ADCCLK, then the minimum value of the event interval to trigger the injection
channel is 29 ADCCLK.
l

Auto-injection

The IAUTO bit is set to 1, and conversion of the selected channel of the injection group is performed
automatically after scanning all the channels selected by the rule group for conversion. This approach can be
used to convert up to 20 conversion sequences in the ADC_RSQRx and ADC_ISQR registers.
In this mode, external triggering of the injection channel must be disabled (IEXTTRIG JEXTTRIG=0).
Note: For ADC clock prescaler factor (ADCPRE[1:0]) of 4 to 8, 1 ADCCLK interval is automatically inserted
when switching from rule conversion to injection sequence or from injection conversion to rule sequence;
when ADC clock prescaler factor is 2, there is a delay of 2 ADCCLK intervals.
3)

Single intermittent mode conversion

The intermittent mode of the rule group or injection group is entered by setting the RDISCEN or IDISCEN bit
of the ADC_CTLR1 register to 1. This mode differs from scanning a complete set of channels in scan mode,
but divides a set of channels into multiple short sequences, and each external trigger event will perform a short
sequence of scan transitions.
The length of the short sequence n (n<=8) is defined in DISCNUM[2:0] of ADC_CTLR1 register, when
RDISCEN is 1, it is the interrupted mode of the rule group, and the total length to be converted is defined in
RLEN[3:0] of ADC_RSQR1 register; when IDISCEN is 1, it is the interrupted mode of the injection group,
and the total length to be converted is defined in ILEN[1:0] of ADC_ISQR register. It is not possible to set
both the rule group and the injection group to intermittent mode.
Example of rule group intermittent mode.
RDISCEN=1, DISCNUM[2:0]=3, RLEN[3:0]=8, channels to be converted = 1, 3, 2, 5, 8, 4, 10, 6
The 1st external trigger: conversion sequence is: 1, 3, 2
The 2nd external trigger: conversion sequence is: 5, 8, 4
The 3rd external trigger: conversion sequence is: 10, 6, while generating EOC events
The 4th external trigger: conversion sequence is: 1, 3, 2
Examples of intermittent patterns injected into groups.
IDISCEN=1, DISCNUM[2:0]=1, ILEN[1:0]=3, channel to be converted=1, 3, 2
The 1st external trigger: conversion sequence is: 1
The 2nd external trigger: the conversion sequence is: 3
The 3rd external trigger: conversion sequence is: 2, generating both EOC and JEOC events
The 4th external trigger: conversion sequence is: 1
Note: 1. When converting a rule group or injection group in intermittent mode, the conversion sequence does
not automatically start from the beginning when it ends. When all subgroups have been converted, the next
trigger event starts the conversion of the first subgroup.
2. You cannot use auto-injection (IAUTO=1) and intermittent mode at the same time.
3. You cannot set intermittent mode for both rule groups and injection groups, and intermittent mode
V1.3
75
http://wch.cn

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents