![ARTERY AT32F435 Series Скачать руководство пользователя страница 308](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592308.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 308
Rev 2.03
C2IN
Low
Up
Down
Down
Up
Figure 14-74
Example of encoder interface mode C
20
21
22
23
24
25
26
27
26
25
24
23
22
21
20
1F
COUNTER
0x3
TWCMSEL
[1:0]
CI1RAW
CI2RAW
UP
DOWN
14.4.3.3 TMR input function
Each timer of TMR1, TMR8 and TMR20 has four independent channels. Each channel can be configured
as input or output.
As input, each channel input signal is handled as follows:
−
TMRx_CHx outputs the pre-processed CxIRAW. The C1INSEL bit is used to select the source of
C1IRAW from TMRx_CH1 or the XOR-ed TMRx_CH1, TMRx_CH2 and TMRx_CH3. The sources
of C2IRAW, C3IRAW and C4IRAW are TMRx_CH2, TMRx_CH3 and TMRx_CH4, respectively.
−
CxIRAW inputs digital filter and outputs filtered CxIF signal. The digital filter uses the CxDF bit to
program sampling frequency and sampling times.
−
CxIF inputs edge detector, and outputs the CxIFPx signal after edge selection. The edge selection
depends on both CxP and CxCP bits. It is possible to select input rising edge, falling edge or both
edges.
−
CxIFPx inputs capture signal selector, and outputs the CxIN signal after capture signal selection.
The capture signal selection is defined by CxC bit . It is possible to select CxIFPx, CyIFPx or STCI
as CxIN source. Of those, CyIFPx (x
≠
y) is the CyIFPy signal that is from Y channel and processed
by channel -x edge detector (for example, C1IFP2 is the channel 1
’
s C1IFP1 signal that passed
through channel 2 edge detection). The STCI comes from slave timer controller, and its source is
selected by STIS bit.
−
CxIN outputs the CxIPS signal that is divided by input channel divider. The divider factor can be
defined as No division, /2, /4 or /8, by the CxIDIV bit . It can be used for filtering, selection, division
and input capture of input signals.
Figure 14-495
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
XOR
C1P/C1CP
edge detector
C1IN
TMRx_CH2
TMRx_CH3
TMRx_CH1
C1INSEL
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