GD32W51x User Manual
366
conversion.
Figure 14-8. Triggered insertion
CH0
CH1
CH1
CH2
CH3
CH3
CH4
Inserted
trigger
Sample
Convert
· · ·
CH11
CH11
EOIC
EOC
Regular
group
Inserted
group
14.4.6.
Analog watchdog
The analog watchdog is enabled when the RWDEN and IWDEN bits in the ADC_CTL0
register are set for regular and inserted channel groups respectively. When the analog voltage
converted by the ADC is below the low threshold or above the high threshold, the WDE bit in
ADC_STAT register will be set. An interrupt will be generated if the WDEIE bit is set. The
ADC_WDHT and ADC_WDLT registers are used to specify the high and low threshold. The
comparison is done before the alignment, so the threshold value is independent of the
alignment, which is specified by the DAL bit in the ADC_CTL1 register. One or more channels,
which are selected by the RWDEN, IWDEN, WDSC and WDCHSEL [4:0] bits in ADC_CTL0
register, can be monitored by the analog watchdog.
14.4.7.
Data alignment
The alignment of data stored after conversion can be specified by DAL bit in the ADC_CTL1
register.
After being decreased by the user-defined offset written in the ADC_IOFFx registers, the
inserted group data value may be a negative value. The sign value is extended.
When left-aligned, the 12 data are aligned on a half-word basis as shown below
Data alignment of 12-bit resolution
.