![Geehy SEMICONDUCTOR APM32F405 Series User Manual Download Page 204](http://html1.mh-extra.com/html/geehy-semiconductor/apm32f405-series/apm32f405-series_user-manual_573630204.webp)
www.geehy.com Page 203
Figure 39 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
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.