AT32F425
Series Reference Manual
2022.03.30
Page 240
Ver 2.01
14.5.2 TMR16 and TMR17 main features
The main functions of general-purpose TMR16 and TMR17 include:
Souce of counter clock: internal clock, external clock an internal trigger input
16-bit upcounter and 8-bit repetition counter
1x independent channel for input capture, output compare, PWM generation, one-pulse mode
output and embedded dead-time
1x independent channel for complementary output
TMR break function
Synchronization control between master and slave timers
Interrrupt/DMA is generated at overflow event, trigger event, break signal input and channel
event
Support TMR burst DMA transfer
Figure 14-62
Block diagram of TM R16 and TMR17 timer
Prescaler
Output
control
C1ORAW
C1OUT
C1COUT
BRK
Clock failure event
From clock control CSS(Clock Security System)
TMRx_BRK
TMRx_CH1
TMRx_CH1
TMRx_CH1C
C1IRAW
Polarity selection
Edge detector
Input filter
CxDT
(INPUT)
CxDT
(OUTPUT)
DTG
Filter
14.5.3 TMR16 and TMR17 functional overview
14.5.3.1 Count clock
The count clock of TMR16 and TMR17 can be provided by the internal clock (CK_INT).
Internal clock (CK_INT)
By default, the CK_INT divided by the prescaler is used to drive the counter to start counting.
Figure 14-63
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.5.3.2 Counting mode
Each of the general-purpose timers (TMR16 and TMR17) consists of a 16-bit upcounter. 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.