![GigaDevice Semiconductor GD32E23 Series Скачать руководство пользователя страница 236](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32e23-series/gd32e23-series_user-manual_2225794236.webp)
GD32E23x User Manual
236
0x1, 0x2 or 0x3.
SMC1== 1’b1 (external clock mode 1). External input ETI is selected as timer clock
source (ETI)
The TIMER_CK, which drives counter’s prescaler to count, can be triggered by the event of
rising or falling edge on the external pin ETI. This mode can be selected by setting the SMC1
bit in the TIMERx_SMCFG register to 1. The other way to select the ETI signal as the clock
source is to 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 ETI signal is
selected as clock source, the trigger controller including the edge detection circuitry will
generate a clock pulse on 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-3. 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 will start counting up from 0 again and an overflow event