GD32W51x User Manual
554
Figure 17-58. Repetition timechart for up-counter
CEN
CNT_REG
60
61 62 63 00 01
62 63 00 01
62 63
Underflow
Overflow
TIMERx_CREP = 0x0
TIMER_CK
00 01
62 63 00 01
UPIF
TIMERx_CREP = 0x1
62 63 00 01
62 63 00 01
UPIF
UPIF
TIMERx_CREP = 0x2
CNT_CLK
Capture/compare channels
The general level4 timer has one independent channels which can be used as capture inputs
or compare match outputs. Each channel is built around a channel capture compare register
including an input stage, channel controller and an output stage.
Input capture mode
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 enabled by
CHxIE = 1.