![GigaDevice Semiconductor GD32E23 Series Скачать руководство пользователя страница 391](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32e23-series/gd32e23-series_user-manual_2225794391.webp)
GD32E23x User Manual
391
Update event (from overflow/underflow) rate configuration
The rate of update events generation (from overflow and underflow events) can be
configured by the TIMERx_CREP register. Counter repetition is used to generator update
event or updates the timer registers only after a given number (N+1) of cycles of the counter,
where N is CREP in TIMERx_CREP register. The repetition counter is decremented at each
counter overflow in up counting mode.
Setting the UPG bit in the TIMERx_SWEVG register will reload the content of CREP in
TIMERx_CREP register and generator an update event.
Figure 14-75.
Repetition counter timing chart of up counting mode
CEN
CNT_REG
96
97 98 99 0
1
98 99 0
1
98 99
Underflow
Overflow
TIMERx_CREP = 0x0
TIMER_CK
0
1
98 99
0
1
UPIF
TIMERx_CREP = 0x1
98 99
0
1
98 99
0
1
UPIF
UPIF
TIMERx_CREP = 0x2
PSC_CLK
Input capture and output 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.
Channel input capture function
Channel input capture function allows the channel to perform measurements such as pulse
timing, frequency, period 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.