Table 253. Counting Direction Versus Encoder Signals (Cc1P = Cc2P = 0) - ST STM32G4 Series Reference Manual

Advanced arm-based 32-bit mcus
Hide thumbs Also See for STM32G4 Series:
Table of Contents

Advertisement

RM0440

Table 253. Counting direction versus encoder signals (CC1P = CC2P = 0)

Active edge
SMS[3:0]
Counting on
tim_ti1 only
1110
x1 mode
Counting on
tim_ti2 only
1111
x1 mode
Counting on
tim_ti1 only
0001
x2 mode
Counting on
tim_ti2 only
0010
x2 mode
Counting on
tim_ti1 and
0011
tim_ti2
x4 mode
A quadrature encoder can be connected directly to the MCU without external interface logic.
However, comparators are normally be used to convert the encoder's differential outputs to
digital signals. This greatly increases noise immunity. The third encoder output which
indicate the mechanical zero position, may be connected to the external trigger input and
trigger a counter reset.
The
Figure 326
and direction control. It also shows how input jitter is compensated where both edges are
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, tim_ti1fp1 mapped on tim_ti1).
CC2S='01' (TIMx_CCMR2 register, tim_ti1fp2 mapped on tim_ti2).
CC1P='0' and CC1NP='0' (TIMx_CCER register, tim_ti1fp1 non-inverted,
tim_ti1fp1=tim_ti1).
CC2P='0' and CC2NP='0' (TIMx_CCER register, tim_ti1fp2 non-inverted, tim_ti1fp2=
tim_ti2).
SMS='011' (TIMx_SMCR register, both inputs are active on both rising and falling
edges).
CEN='1' (TIMx_CR1 register, Counter enabled).
Level on
opposite
signal
(tim_ti1fp1 for
Rising
tim_ti2,
tim_ti2fp2 for
tim_ti1)
High
Down
Low
No count
High
No count
Low
No count
High
Down
Low
Up
High
No count
Low
No count
High
Down
Low
Up
gives an example of counter operation, showing count signal generation
RM0440 Rev 1
Advanced-control timers (TIM1/TIM8/TIM20)
tim_ti1fp1 signal
Falling
Up
No count
No count
No count
Up
Down
No count
No count
Up
Down
tim_ti2fp2 signal
Rising
Falling
No count
No count
No count
No count
Up
Down
No count
No count
No count
No count
No count
No count
Up
Down
Down
Up
Up
Down
Down
Up
1103/2083
1181

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32G4 Series and is the answer not in the manual?

Table of Contents

Save PDF