GD32F20x User Manual
257
Figure 14-2. Single conversion mode
CH2
CH2
CH2
CH2
CH2
EOC
Regular
trigger
Sample
Convert
After conversion of a single regular 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.
After conversion of a single inserted channel, the conversion data will be stored in the
ADC_IDATA0 register, the EOC and EOIC will be set. An interrupt will be generated if the
EOCIE or EOICIE bit is set.
Software procedure for a single conversion of a regular 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
3.
Configure ADC_SAMPTx register
4.
Configure ETERC and ETSRC bits in the ADC_CTL1 register if in need
5.
Set the SWRCST bit, or generate an external trigger for the regular group
6.
Wait the EOC flag to be set
7.
Read the converted in the ADC_RDATA register
8.
Clear the EOC flag by writing 0 to it
Software procedure for a single conversion of an inserted channel:
1.
Make sure the DISIC, SM in the ADC_CTL0 register are reset
2.
Configure ISQ3 with the analog channel number
3.
Configure ADC_SAMPTx register
4.
Configure ETEIC and ETSIC bits in the ADC_CTL1 register if in need
5.
Set the SWICST bit, or generate an external trigger for the inserted group
6.
Wait the EOC/EOIC flags to be set
7.
Read the converted in the ADC_IDATA0 register
8.
Clear the EOC/EOIC flags by writing 0 to them
Continuous conversion mode
This mode can be run on the regular channel group. The continuous conversion mode will be
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 ...