AT32F425
Series Reference Manual
2022.03.30
Page 212
Ver 2.01
Figure 14-32 Block diagram of general-purpose TMR13/14
Trigger
controller
TMRxCLK from RCC
C1IFP1
DIV prescaler
+/- CNT Counter
Period register
Stop, clear
prescaler
Output
control
C1ORAW
C1OUT
TMRX_CH1
TMRx_CH1
Enable
couting
C1IRAW
Edge detector
Input filter
CxDT
input
CxDT
output
14.3.3 TMR13 and TMR14 functional overview
14.3.3.1 Count clock
Internal clock (CK_INT)
By default, the CK_INT divided by the prescaler is used to drive the counter to start counting.
Figure 14-33
Control circuit with CK_INT divided by 1
CK_INT
TMREN
COUNTER
12
11
13
14
15
16
00
01
02
03
04
05
06
07
14.3.3.2 Counting mode
The general-purpose timer consists of a 16-bit counter supporting upcounting mode. The TMRx_PR
register is loaded with the counter value. The value in the TMRx_PR is immediately moved to the shadow
register by deault. When the periodic buffer is enabled (PRBEN=1), the value in the TMRx_PR register
is transferred to the shadow register only at an overflow event. The OVFEN and OVFS bits are used to
configure the overflow event.
Settng TMREN=1 to enable the timer to start counting. Base on synchronization logic, however, the
actual enable signal TMR_EN is set 1 clock cycle after the TMREN is set.
Upcounting mode
In upcounting mode, the counter counts from 0 to the value programmed in the TMRx_PR register,
restarts from 0, and generates a counter overflow event, with the OVFIF bit being set. If the overflow
event is disabled, the register is no longer reloaded with the preload and re-loaded value after counter
overflow occurs, otherwise, the prescaler and re-loaded value will be updated at an overflow event.
Figure 14-34
Overflow event when PRBEN=0
0
1
2
3
...
31
32
0
1
2
3
...
31
32
0
1
2
3
COUNTER
31
32
0
1
32
...
PR[15:0]
OVFIF
TMR_CLK
0
DIV[15:0]
22
Clear
Clear
Clear