AT32F425
Series Reference Manual
2022.03.30
Page 222
Ver 2.01
Figure 14-45
Counting in external clock mode A
30
COUNTER
OVFIF
TMR_CLK
110
STIS[2:0]
Clear
CNT_CLK
C2IRAW
000
C2IF[2:0]
31
32
0
1
2
3
4
Internal trigger input (ISx)
Timer synchronization allows interconnection between several timers. The TMR_CLK of one timer can
be provided by the TRGOUT signal output by another timer. Set the STIS[2: 0] bit to select internal
trigger signal to enable counting.
The TMR15 consists of a 16-bit prescaler, which is used to generate the CK_CNT that enables the
counter to count. The frequency division relationship between the CK_CNT and TMR_CLK can be
adjusted by setting the value of the TMR15_DIV register. The prescaler value can be modified at any
time, but it takes effect only when the next overflow event occurs.
Table 14-9 TMRx internal trigger connection
Slave controller
IS0 (STIS=000)
IS1 (STIS=001)
IS2 (STIS=010)
IS3 (STIS=011)
TMR1
TMR15
TMR2
TMR3
-
TMR2
TMR1
TMR15
TMR3
USB_OTG_SOF
TMR3
TMR1
TMR2
TMR15
-
TMR15
TMR2
TMR3
TMR16
TMR17_OC
Figure 14-46
Counter timing with prescaler value changing from 1 to 4
TMR_CLK
CK_CNT
COUNTER
OVFIF
DIV[15
:
0]
18
17
19
1A
1B
1C
0
3
00
01
Clear
PR[15
:
0]
1C
14.4.3.2 Counting mode
The TMR15 consists of a 16-bit upcounter.. The TMR15_PR register is loaded with the counter value.
The value in the TMR15_PR is immediately moved to the shadow register by deault. When the periodic
buffer is enabled (PRBEN=1), the value in the TMR15_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.