General purpose timer (TIMx)
selected. This might occur if the sensor is positioned near to one of the switching points. For
this example we assume that the configuration is the following:
CC1S='01' (TIMx_CCMR1 register, IC1FP1 mapped on TI1).
CC2S='01' (TIMx_CCMR2 register, IC2FP2 mapped on TI2).
CC1P='0' (TIMx_CCER register, IC1FP1 non-inverted, IC1FP1=TI1).
CC2P='0' (TIMx_CCER register, IC2FP2 non-inverted, IC2FP2=TI2).
SMS='011' (TIMx_SMCR register, both inputs are active on both rising and falling
edges).
CEN='1' (TIMx_CR1 register, Counter is enabled).
Figure 107. Example of counter operation in encoder interface mode.
Counter
Figure 108
configuration as above except CC1P='1').
Figure 108. Example of encoder interface mode with IC1FP1 polarity inverted.
Counter
The timer, when configured in Encoder Interface mode provides information on the sensor's
current position. You can obtain dynamic information (speed, acceleration, deceleration) by
measuring the period between two encoder events using a second timer configured in
capture mode. The output of the encoder which indicates the mechanical zero can be used
for this purpose. Depending on the time between two events, the counter can also be read
240/501
forward
TI1
TI2
up
gives an example of counter behavior when IC1FP1 polarity is inverted (same
forward
jitter
TI1
TI2
down
jitter
backward
down
backward
up
jitter
forward
up
jitter
forward
down
RM0008
Need help?
Do you have a question about the STM32F101 Series and is the answer not in the manual?
Questions and answers