AT32F421
Series Reference Manual
2022.11.11
Page 218
Rev 2.02
each counter overflow. An overflow event is generated only when the repetition counter reaches 0. The
frequency of the overflow event can be adjusted by setting the repetition counter value.
Figure 14-59 OVFIF when RPR=2
0
1
2
3
...
31
32
0
1
2
3
...
31
32
0
1
2
3
COUNTER
31
32
0
1
32
...
PR[15:0]
2
1
0
RPR[7:0]
OVFIF
14.4.3.3 TMR input function
The TMR15 timer has two independent channels, each of which can be configured as input or output.
As input, each channel input signal is processed as below:
–
TMRx_CHx outputs the pre-processed CxIRAW. Set the C1INSEL bit to select TMRx_CHx as the
source of CxIRAW.
–
CxIRAW inputs digital filter and outputs a filtered signal CxIF. Set the sampling frequency and times
of digital filter by setting the CxDF bit.
–
CxIF inputs edge detector and outputs the signal CxIFPx after edge selection. The edge selection
is controlled by CxP and CxCP bits, and can be selected as rising edge, falling edge or both edges
active.
–
CxIFPx inputs capture signal selector and outputs the signal CxIN after selection. The capture signal
selector is controlled by the CxC bits. The source of CxIN can be set as CxIFPx, CyIFPx or STCI.
The CyIFPx (
x≠y) is the CyIFPy from channel y and handled by channel x edge detector (for
example, the C1IFP2 is the C1IFP1 from channel 1 and then handled by channel 2 edge detector),
and STCI derives from the slave timer controller, and its source is selected by setting the STIS bit.
–
CxIN outputs the signal CxIPS through the input channel
divider. The division factor is set to “no
division
”, “divided by 2”, “divided by 4” or “divided by 8” by setting the CxIDIV bit.
Figure 14-60 Input/output channel 1 main circuit
Capture
CNT counter
C1DT
Compare
C1DT
preload
0
1
C1OBEN
C1DT_shadow
C1OCTRL
Overflow event
DTC
Dead time
C1ORAW
1
0
C1EN
1
0
0
1
disable
C1P
FCSOEN
OEN
1
0
C1CEN
1
0
0
1
disable
C1CP
FCSOEN
OEN
C1P/C1CP
edge detector
C1IN
TMRx_CH1
C1IRAW
filter
C1DF
C1IFP1
C2IFP1
STCI
C1C
C1IDIV
input divider
Capture trigger
C1P
polarity select
C1CP
polarity select
BRK
BRK
C1OUT
C1COUT
to GPIO
to GPIO
0
1
disable
frozen
state
0
1
0
1
C1IOS
FCSODIS
0
1
disable
frozen
state
0
1
0
1
C1CIOS
FCSODIS
C1EN