Nations Technologies Inc.
Tel
:
+86-755-86309900
:
info@nationstech.com
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
195
/
631
Table 10-1 Counting direction versus encoder signals
Active edge
Level on opposite signals
(TI1FP1 forTI2,
TI2FP2 for TI1)
TI1FP1 signal
TI2FP2 signal
Rising
Falling
Rising
Falling
Counting only at TI1
High
Counting down
Counting up
Don't count
Don't count
Low
Counting up
Counting down
Don't count
Don't count
Counting only at TI2
High
Don't count
Don't count
Counting up
Counting down
Low
Don't count
Don't count
Counting down
Counting up
Counting on
TI1 and TI2
High
Counting down
Counting up
Counting up
Counting down
Low
Counting up
Counting down
Counting down
Counting up
Here is an example of an encoder with dual edge triggering selected to suppress input jitter:
1. IC1FP1 is mapped to TI1 (TIMx_CCMOD1.CC1SEL= ‘01’), IC1FP1 is not inverted (TIMx_CCEN.CC1P= ‘0’);
2. IC1FP2 is mapped to TI2 (TIMx_CCMOD2.CC2SEL= ‘01’), IC2FP2 is not inverted (TIMx_CCEN.CC2P= ‘0’);
3. The input is valid on both rising and falling edges (TIMx_SMCTRL.SMSEL = ‘011’);
4. Enable counter TIMx_CTRL1.CNTEN= ‘1’;
Figure 10-32 Example of counter operation in encoder interface mode
The following figure shows the example of counter behavior when IC1FP1 polarity is inverted (CC1P= '1', other
configurations are the same as above)
TI2
Counter
Up
TI1
Down
Backward
Jitter
Forward
Jitter