GD32F20x User Manual
261
2.
Configure DISNUM[2:0] bits in the ADC_CTL0 register
3.
Configure ADC_RSQx and ADC_SAMPTx registers
4.
Configure ETERC and ETSRC bits in the ADC_CTL1 register if in need
5.
Prepare the DMA module to transfer data from the ADC_RDATA (refer to the spec of the
DMA
module).
6.
Set the SWRCST bit, or generate an external trigger for the regular group
7.
Repeat step6 if in need.
8.
Wait the EOC flag to be set
9.
Clear the EOC flag by writing 0 to it
Software procedure for discontinuous conversion on an inserted channel group:
1.
Set the DISIC bit in the ADC_CTL0 register
2.
Configure ADC_ISQ and ADC_SAMPTx registers
3.
Configure ETEIC and ETSIC bits in the ADC_CTL1 register if in need
4.
Set the SWICST bit, or generate an external trigger for the inserted group
5.
Repeat step4 if in need
6.
Wait the EOC/EOIC flags to be set
7.
Read the converted in the ADC_IDATAx register
8.
Clear the EOC/EOIC flag by writing 0 to them
14.4.6.
Inserted channel management
Auto-insertion
The inserted group channels are automatically converted after the regular group channels
when the ICA bit in ADC_CTL0 register is set. In this mode, external trigger on inserted
channels cannot be enabled. A sequence of up to 20 conversions programmed in the
ADC_RSQ0~ADC_RSQ2 and ADC_ISQ registers can be used to convert in this mode. In
addition to the ICA bit, if the CTN bit is also set, regular channels followed by inserted
channels are continuously converted.
Figure 14-7. Auto-insertion, CTN = 1
CH0
CH1
CH2
CH3
CH4
Sample
Convert
·
·
·
CH15
EOIC
EOC
CH0
CH1
Regular
group
Inserted
group
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 ...