
AT32F413
Series Reference Manual
2022.06.27
Page 183
Rev 2.00
14.1.2 TMRx main features
Source of count clock is selectable: internal clock, external clock and internal trigger
16-bit up, down, up/down and encoder mode counter (TMR2/5 can be extended to 32-bit)
4 independent channels for input capture, output compare, PWM generation and one-pulse
mode output
Synchronization control between master and slave timers
Interrupt/DMA is generated at overflow event, trigger event and channel event
Support TMR burst DMA transfer
Figure 14-1
General-purpose timer block diagram
Input filter
XOR
DIV Prescaler
Prescaler
C2IRAW
C3IRAW
C4IRAW
C1IFP1
TMRX_CH4
TMRX_CH3
TMRX_CH2
TMRX_CH1
TMRx_CH4
TMRx_CH3
TMRx_CH2
TMRx_CH1
C1INC
+/- CNT counter
Period register
Stop, clear, or up/down
Edge detector
Input filter
CxDT
Input
CxDT
Output
C4ORAW
C3ORAW
C2ORAW
C1ORAW
Output
control
Output
control
Output
control
Output
control
C4OUT
C3OUT
C2OUT
C1OUT
Polarity selection
edge detector
prescaler
IS3
IS2
IS1
IS0
C21FP1
TMRx_EXT
Trigger control
Slave mode
controller
Encoder
interface
Reset,enable,up/down,count
TRGOUT,to
ADC/DAC
C1IRAW
14.1.3 TMRx functional overview
14.1.3.1 Count clock
The count clock of TMR2~TMR5 can be provided by the internal clock (CK_INT), external clock (external
clock mode A and B) and internal trigger input (ISx)
Internal clock (CK_INT)
By default, the CK_INT divided by the prescaler is used to drive the counter to start counting.
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
External clock
(
TRGIN/EXT
)
The counter clock can be provided by two external clock sources, namely, TRGIN and EXT signals.
When SMSEL=3’111, external clock mode A is selected. Set the STIS[2: 0] bit to select TRGIN signal to
drive the counter to start counting.
When ECMBEN=1,
external clock mode B is selected. The counter starts counting driven by EXT
signal.