GD32F20x User Manual
258
enabled when CTN bit in the ADC_CTL1 register is set. In this mode, the ADC performs
conversion on the channel specified in the RSQ0[4:0]. When the ADCON has been set high,
the ADC samples and converts specified channel, once the corresponding software trigger or
external trigger is active. The conversion data will be stored in the ADC_RDATA register.
Figure 14-3. Continuous conversion mode
CH2
CH2
CH2
CH2
CH2
CH2
EOC
Regular
trigger
Sample
Convert
CH2
Software procedure for continuous conversion on a regular channel:
1.
Set the CTN bit in the ADC_CTL1 register
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
9.
Repeat steps 6~8 as soon as the conversion is in need
To get rid of checking, DMA can be used to transfer the converted data:
1.
Set the CTN and DMA bit in the ADC_CTL1 register
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.
Prepare the DMA module to transfer data from the ADC_RDATA.
6.
Set the SWRCST bit, or generate an external trigger for the regular group
Scan conversion mode
The scan conversion mode will be enabled when SM bit in the ADC_CTL0 register is set. In
this mode, the ADC performs conversion on the channels with a specific sequence specified
in the ADC_RSQ0~ADC_RSQ2 registers or ADC_ISQ register. When the ADCON has been
set high, the ADC samples and converts specified channels one by one in the regular or
inserted group till the end of the regular or inserted group, once the corresponding software
Содержание GD32F20 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F20x ARM Cortex M3 32 bit MCU User Manual Revision 2 2 Oct 2019 ...
Страница 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Страница 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Страница 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Страница 385: ...GD32F20x User Manual 385 ...
Страница 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...