AT32F421
Series Reference Manual
2022.11.11
Page 203
Rev 2.02
14.3 General-purpose timer (TMR14)
14.3.1 TMR14 introduction
The general-purpose timer TMR14 consists of a 16-bit counter supporting upcounting mode. The timer
can be synchronized together with other timers.
14.3.2 TMR14 main features
Source of count clock : internal clock
16-bit up counter
1x independent channels for input capture, output compare and PWM generation
Synchronization control between master and slave timers
Interrupt generation on the overflow event and channel event
Figure 14-38 Block diagram of general-purpose TMR14
TMRx_CH1
TMRx_DIV
CNT counter
CH1 edge
detector
CH1 filter
C1IRAW
C1IN DIV
C1IFP1(C1IN)
C1DT
C1C
0
IN MODE
C1C=0
OUT MODE
C1DT
Compare
C1ORAW
Output1
control
C1OUT
CK_INT(from CRM)
DIV counter
preload
Overflow event
TMRx_CH1
CNT counter
Capture
14.3.3 TMR14 functional overview
14.3.3.1 Count clock
The counter of TMR14 can be clocked by the internal clock (CK_INT).
Figure 14-39 Count clock
CK_INT(form CRM)
DIV_counter
CK_CNT
CNT_counter
Internal clock (CK_INT)
By default, the CK_INT divided by a prescaler is used to drive the counter to start counting. The
configuration process is as follows:
–
Set the TMRx_DIV register to set the counting frequency;
–
Set the TMRx_PR register to set the counting period;
–
Set the TMREN bit in the TMRx_CTRL1 register to enable the counter.
Figure 14-40 Use CK_INT to drive counter, with TMRx_DIV=0x0 and TMRx_PR=0x16
CK_INT
TMREN
COUNTER
12
11
13
14
15
16
00
01
02
03
04
05
06
07
overflow
OVFIF