GD32A50x User Manual
270
14.4.2.
ADC clock
The CK_ADC clock is synchronous with the AHB and provided by the clock controller. ADC
clock can be divided and configured by RCU controller.
14.4.3.
ADC enable
The ADCON bit on the ADC_CTL1 register is the enable switch of the ADC module. The ADC
module will keep in reset state if this bit is 0. For power saving, when this bit is reset, the
analog sub-module will be put into power off mode. After ADC is enabled, you need delay t
su
time for sampling, the value of t
su
please refer to the chip datasheet.
14.4.4.
Routine sequence
The channel management circuit can organize the sampling conversion channels into a
sequence: routine sequence. The routine sequence supports up to 16 channels, and each
channel is called routine channel.
The ADC_RSQ0~ADC_RSQ2 registers specify the selected channels of the routine
sequence. The RL[3:0] bits in the ADC_RSQ0 register specify the total conversion sequence
length.
14.4.5.
Operation modes
Single operation mode
In the single operation mode, the ADC performs conversion on the channel specified in the
RSQ0[4:0] bits of ADC_RSQ2 at a routine trigger. When the ADCON has been set high, the
ADC samples and converts a single channel, once the corresponding software trigger or
TRIGSEL trigger is active.
Figure 14-2. Single operation mode
CH2
CH2
CH2
CH2
CH2
EOC
Routine
trigger
Sample
Convert
After conversion of a single routine channel, the conversion data will be stored in the
ADC_RDATA register, the EOC will be set. An interrupt will be generated if the EOCIE bit is
set.
Software procedure for a single operation mode of a routine channel:
1.
Make sure the DISRC, SM in the ADC_CTL0 register and CTN bit in the ADC_CTL1
register are reset.
2.
Configure RSQ0 with the analog channel number.