![Geehy SEMICONDUCTOR APM32F405 Series User Manual Download Page 260](http://html1.mh-extra.com/html/geehy-semiconductor/apm32f405-series/apm32f405-series_user-manual_573630260.webp)
www.geehy.com Page 259
Timebase unit
The time base unit in the basic timer contains three registers:
16-bit counter register (CNT)
16-bit auto reload register (AUTORLD)
16-bit prescaler register (PSC)
Counter CNT
The basic timer only has one count mode: count-up
Count-up mode
When the counter is in count-up mode, the counter will count up from 0; every
time a pulse is generated, the counter will increase by 1 and when the value of
the counter (TMRx_CNT) is equal to the value of the auto reload
(TMRx_AUTORLD), then the counter will start to count again from 0, a count-up
overrun event will be generated, and the value of the auto reload
(TMRx_AUTORLD) is written in advance.
Disable the update event and set UD bit of TMRx_CTRL1 register to 1.
Generate the update interrupt or DMA request and set URSSEL bit in
TMRx_CTRL1 register.
When an update event occurs, both the auto reload register and the prescaler
register will be updated.