www.geehy.com Page 236
the counter value is (AUTORLD-1), a counter overrun event will be generated;
in counting down, when the counter value is 1, a counter underrun event will be
generated.
The figure below is Timing Diagram when Division Factor is 1 or 2 in Center-
aligned Mode
Figure 58 Timing Diagram when Division Factor is 1 or 2 in Center-aligned Mode
CNT_EN
CK_CNT
04
03
02
01
00
01
02
03
04
03
02
01
Counter register
Counter underrun
Counter overrun
CK_PSC
PSC=1
CK_CNT
00
01
0003
0002
0001
0000
0001
0002
0003
Counter overrun
Update event
PSC=2
Counter register
Update event
Prescaler PSC
The prescaler is 16 bits and programmable, and it can divide the clock
frequency of the counter to any value between 1 and 65536 (controlled by
TMRx_PSC register), and after frequency division, the clock will drive the
counter CNT to count. The prescaler has a buffer, which can be changed during
running.
Input capture
Input capture channel
The general-purpose timer has four independent capture/compare channels,
each of which is surrounded by a capture/compare register.