www.geehy.com Page 99
Figure 23 Timing Diagram when Division Factor is 1 or 2 in Count-up Mode
CNT_EN
CK_CNT
21
22
23
24
25
26
27
00
01
02
03
04
Counter register
Counter overrun
Update event
CK_PSC
PSC=1
CK_CNT
05
06
0024
0025
0026
0000
0001
0002
0003
Counter overrun
Update event
PSC=2
Counter register
Count-down mode
Set to the count-down mode by CNTDIR bit of configuration control register
(TMRx_CTRL1).
When the counter is in count-down mode, the counter will start to count down
from the value of the auto reload (TMRx_AUTORLD); every time a pulse is
generated, the counter will decrease by 1 and when it becomes 0, the counter
will start to count again from (TMRx_AUTORLD), meanwhile, a count-down
overrun event will be generated, and the value of the auto reload
(TMRx_AUTORLD) is written in advance.
When the counter overruns, an update event will be generated. At this time, the
repeat count shadow register, the auto reload shadow register and the prescaler
buffer will be updated. The update event can be disabled by configuring the UD
bit of the TMRx_CTRL1 register.