AT32F425
Series Reference Manual
2022.03.30
Page 187
Ver 2.01
14.1
Basic timer (TMR6 and TMR7)
14.1.1 TMR6 and TMR7 introduction
Each of the basic timers (TMR6 and TMR7) includes a 16-bit up counter and the corresponding control
logic. without being connected to external I/Os, they can be used for a basic timing.
14.1.2 TMR6 and TMR7 main features
16-bit up counter, reload
16-bit prescaler used to divide the TMR_CLK frequency by any factor between 1 and 65536
Figure 14-1 Basic timer block diagram
TMRxCLK from CRM
Reset, Enable, Count
DIV
prescaler
counter
Trigger
controller
Controller
TRGOUT
To DAC
Period
register
14.1.3 TMR6 and TMR7 function overview
14.1.3.1 Count clock
The counter clock of TMR6 and TMR7 is provided by the internal clock source (CK_INT) divided by
prescaler.
Figure 14-2 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.1.3.2 Counting mode
The basic timer only supports upcounting mode. It has an internal 16-bit counter in which the value is
loaded with the TMRx_PR register. 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 the TMREN bit (TMREN=1) enables 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.
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 counter is no longer reloaded with the preload and re-loaded value on counter
overflow, otherwise, the prescaler and re-loaded value will be updated on overflow event.