EasyManuals Logo
Home>ST>Microcontrollers>STM32G474

ST STM32G474 User Manual

ST STM32G474
2126 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1147 background imageLoading...
Page #1147 background image
RM0440 Rev 4 1147/2126
RM0440 Advanced-control timers (TIM1/TIM8/TIM20)
1226
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 329 gives an example of counter operation, showing count signal generation
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).
Table 260. Counting direction versus encoder signals (CC1P = CC2P = 0)
Active edge SMS[3:0]
Level on
opposite
signal
(tim_ti1fp1 for
tim_ti2,
tim_ti2fp2 for
tim_ti1)
tim_ti1fp1 signal tim_ti2fp2 signal
Rising Falling Rising Falling
Counting on
tim_ti1 only
x1 mode
1110
High Down Up No count No count
Low No count No count No count No count
Counting on
tim_ti2 only
x1 mode
1111
High No count No count Up Down
Low No count No count No count No count
Counting on
tim_ti1 only
x2 mode
0001
High Down Up No count No count
Low Up Down No count No count
Counting on
tim_ti2 only
x2 mode
0010
High No count No count Up Down
Low No count No count Down Up
Counting on
tim_ti1 and
tim_ti2
x4 mode
0011
High Down Up Up Down
Low Up Down Down Up

Table of Contents

Questions and Answers:

ST STM32G474 Specifications

General IconGeneral
BrandST
ModelSTM32G474
CategoryMicrocontrollers
LanguageEnglish

Related product manuals