![GigaDevice Semiconductor GD32E23 Series Скачать руководство пользователя страница 293](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32e23-series/gd32e23-series_user-manual_2225794293.webp)
GD32E23x User Manual
293
is set the SMC [2:0] to 0x7 and the TRGS [2:0] to 0x7 respectively. Note that the ETI signal is
derived from the ETI pin sampled by a digital filter. When the clock source is selected to
come from the ETI signal, the trigger controller including the edge detection circuitry will
generate a clock pulse during each ETI signal rising edge to clock the counter prescaler.
Clock prescaler
The counter clock (PSC_CK) is obtained by the TIMER_CK through the prescaler, and the
prescale factor can be configured from 1 to 65536 through the prescaler register
(TIMERx_PSC). The new written prescaler value will not take effect until the next update
event.
Figure 14-33.
Timing chart of PSC value change from 0 to 2
TIMER_CK
CEN
PSC_CLK
CNT_REG
Reload Pulse
Prescaler CNT
Prescaler
shadow
94
95
96
97
98
99
0
2
0
2
0
1
2
0
1
2
0
1
PSC value
UPG
0
2
0
1
2
Counter up counting
In this mode, the counter counts up continuously from 0 to the counter reload value, which is
defined in the TIMERx_CAR register, in a count-up direction. Once the counter reaches the
counter reload value, the counter restarts from 0. The update event is generated each time
when counter overflows. The counting direction bit DIR in the TIMERx_CTL0 register should
be set to 0 for the up counting mode.
Whenever, if the update event software trigger is enabled by setting the UPG bit in the
TIMERx_SWEVG register, the counter value will be initialized to 0 and an update event will
be generated.
If the UPDIS bit in TIMERx_CTL0 register is set, the update event is disabled.