![GigaDevice Semiconductor GD32F10 Series Скачать руководство пользователя страница 215](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32f10-series/gd32f10-series_user-manual_2225800215.webp)
GD32F10x User Manual
215
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.
Software procedure for single operation mode of a routine 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
routine sequence.
6.
Wait the EOC flag to be set.
7.
Read the converted data in the ADC_RDATA register.
8.
Clear the EOC flag by writing 0 to it.
Continuous operation mode
The continuous operation mode will be 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 11-3. Continuous operation mode
CH2
CH2
CH2
CH2
CH2
CH2
EOC
Routine
trigger
Sample
Convert
CH2
Software procedure for continuous operation on a
routine 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
routine sequence.
6.
Wait the EOC flag to be set.
7.
Read the converted data 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.
Содержание GD32F10 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F10x Arm Cortex M3 32 bit MCU User Manual Revision 2 6 Jun 2022 ...
Страница 63: ...GD32F10x User Manual 63 programmed during the chip production ...
Страница 117: ...GD32F10x User Manual 117 010 1 0 011 0 9 ...
Страница 416: ...GD32F10x User Manual 416 shadow register updates every update event ...
Страница 427: ...GD32F10x User Manual 427 value ...
Страница 518: ...GD32F10x User Manual 518 These bits are not used in SPI mode ...