GD32F403xx User Manual
194
4.
Set CLB=1.
5.
Wait until CLB=0.
12.4.2.
ADC clock
The CK_ADC clock is synchronous with the AHB and APB2 clock and provided by the clock
controller. ADC clock can be divided and configured by RCU controller.
12.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.
12.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 RL[3:0] bits in the ADC_RSQ0 register specify the total conversion sequence length. The
ADC_RSQ0~ADC_RSQ2 registers specify the selected channels of the routine sequence .
Note:
Although the ADC supports 18 multiplexed channels,
the maximum length of the
sequence is only 16.
12.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
external trigger is active.
Figure 12-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.