GD32F20x User Manual
260
7.
Clear the EOC/EOIC flag by writing 0 to them
Figure 14-5. Scan conversion mode, continuous enable
CH2
CH1
CH5
CH7
CH11
CH2
CH1
·
·
·
EOC
One circle of regular group, RL=5
Regular
trigger
CH5
CH7
CH11
CH2
Discontinuous mode
For regular channel group, the discontinuous conversion mode will be enabled when DISRC
bit in the ADC_CTL0 register is set. In this mode, the ADC performs a short sequence of n
conversions (n<=8) which is a part of the sequence of conversions selected in the
ADC_RSQ0~ADC_RSQ2 registers. The value of n is defined by the DISNUM[2:0] bits in the
ADC_CTL0 register. When the corresponding software trigger or external trigger is active, the
ADC samples and coverts the next n channels selected in the ADC_RSQ0~ADC_RSQ2
registers until all the channels in the regular sequence are done. The EOC will be set after
every circle of the regular channel group. An interrupt will be generated if the EOCIE bit is set.
For inserted channel group, the discontinuous conversion mode will be enabled when DISIC
bit in the ADC_CTL0 register is set. In this mode, the ADC performs one conversion which is
a part of the sequence of conversions selected in the ADC_ISQ register. When the
corresponding software trigger or external trigger is active, the ADC samples and coverts the
next channel selected in the ADC_ISQ register until all the channels in the inserted sequence
are done. The EOIC will be set after every circle of the inserted channel group. An interrupt
will be generated if the EOICIE bit is set.
The regular and inserted groups cannot both work in discontinuous conversion mode. Only
one group conversion can be set in discontinuous conversion mode at a time.
Figure 14-6. Discontinuous conversion mode
CH2
CH1
CH5
CH7
CH11
CH16
CH2
CH1
· ·
·
Inserted
trigger
EOC
One circle of regular group, RL=8, DISNUM=3'b010
CH9
CH10
CH8
CH9
CH10
· ·
·
EOIC
One circle of inserted group, IL=3
Regular
trigger
Sample
Convert
CH12
CH17
CH5
Software procedure for discontinuous conversion on a regular channel group:
1.
Set the DISRC bit in the ADC_CTL0 register and the DMA bit in the ADC_CTL1 register
Summary of Contents for GD32F20 Series
Page 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Page 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Page 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Page 385: ...GD32F20x User Manual 385 ...
Page 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...