GD32VF103 User Manual
233
Figure 15-11. Repetition counter timing chart of down counting mode
CEN
CNT_REG
03
02
01
00
63
62
…
.
01
00
63
62
…
.
01
00
Underflow
Overflow
TIMERx_CREP = 0x0
TIMER_CK
63
62
…
.
01
00
63
62
UPIF
TIMERx_CREP = 0x1
…
.
01
00
63
62
…
.
01
00
63
62
UPIF
UPIF
TIMERx_CREP = 0x2
CNT_CLK
Capture/compare channels
The advanced timer has four independent channels which can be used as capture inputs or
compare outputs. Each channel is built around a channel capture compare register including
an input stage, a channel controller and an output stage.
Input capture mode
Input capture mode allows the channel to perform measurements such as pulse timing,
frequency, period, duty cycle and so on. The input stage consists of a digital filter, a channel
polarity selection, edge detection and a channel prescaler. When a selected edge occurs on
the channel input, the current value of the counter is captured into the TIMERx_CHxCV
register, at the same time the CHxIF bit is set and the channel interrupt is generated if it is
enabled when CHxIE=1.