GD32F20x User Manual
434
CHxIE = 1.
Figure 18-58. Input capture logic
CI0
Synchronizer
D
presclare
Capture
Register
(
CH0VAL
)
Clock
Processer
Counter
TIMER_CK
Q
Filter
D
Q
D
Q
Edge Detector
CI1FE0
ITS
CH0MS
CH0IF
CH0IE
CH0_CC_I
TIMERx_CC_INT
Capture INT From Other Channal
CH0CAPPSC
Edge selector
&inverter
Based on
CH0P&CH0NP
CI0FE0
Rising/Falling
ITI0
ITI3
ITI1
ITI2
CI0FED
Rising&Falling
IS0
CI0FED
First, the channel input signal (CIx) is synchronized to TIMER_CK domain, and then sampled
by a digital filter to generate a filtered input signal. Then through the edge detector, the rising
and fall edge are detected. You can select one of them by CHxP. One more selector is for
the other channel and trig, controlled by CHxMS. Configuring the IC_prescaler enables an
effective capture event after a number of input events. On the capture event, CHxVAL will
restore the value of Counter.
So the process can be divided to several steps as below:
Step1:
Filter configuration. (CHxCAPFLT in TIMERx_CHCTL0)
Based on the input signal and requested signal quality, configure compatible
CHxCAPFLT.
Step2:
Edge selection. (CHxP/CHxNP in TIMERx_CHCTL2)
Rising or falling edge, choose one by CHxP/CHxNP.
Step3:
Capture source selection. (CHxMS in TIMERx_CHCTL0)
As soon as you select one input capture source by CHxMS, you have set the channel
to input mode (CHxMS != 0x0) and TIMERx_CHxCV cannot be written any more.
Step4:
Interrupt enable. (CHxIE and CHxDEN in TIMERx_DMAINTEN)
Enable the related interrupt; you can got the interrupt and DMA request.
Step5:
Capture enable. (CHxEN in TIMERx_CHCTL2)
Содержание 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 ...