General-purpose timers (TIM2/TIM3/TIM4/TIM5)
register. A transition error interrupt will be generated if the TERRIE bit is set in the
TIMx_DIER register.
For encoder having an Index signal, it is possible to detect abnormal operation resulting in
an excess of pulses per revolution. An encoder with N pulses per revolution will provide 4xN
counts per revolution. The Index signal will reset the counter every 4xN clock periods.
If the counter value is incremented from TIMx_ARR to 0 or decremented from 0 to TIMxARR
value without any index event, this will be reported as an Index position error.
The overflow threshold is programmed using the TIMx_ARR register. A 1000 lines encoder
will result in a counter value being between 0 and 3999 (in 4x reading mode). The overflow
detection threshold must be programmed by setting TIMx_ARR = 3999 + 1 = 4000.
1244/2083
Figure 421. State diagram for quadrature encoded signals
Correct transitions
Erroneous transitions
RM0440 Rev 1
00
01
10
11
RM0440
MSv45779V1
Need help?
Do you have a question about the STM32G4 Series and is the answer not in the manual?
Questions and answers