2025-11-09 9:00 PM - last edited on 2025-11-10 2:29 AM by mƎALLEm
We need to use quadrature phase counting with STM. can u please confirm if phase failure is supported in this mode or not .
2025-11-10 12:14 AM
Could you please tell some details about your task, which encoder you have and which mode you talk about?
2025-11-10 12:34 AM
Hi,
In quadrature phase counting ( If i use Encoder mode of TIM timers) , phase A and B are thr. If any one phase is missing or failed then that detected by the hardware encoder automatically or not..
2025-11-10 1:02 AM
I assume you talk about an illegal phase change, where both signals change at the same time (e.g. b10 -> b01) while it is expected to have only one changed at once (e.g. b10 -> b11 -> b01...).
In general this can be detected and handled by an interrupt, see page 17 here:
https://www.st.com/resource/en/product_training/STM32G4-WDG_TIMERS-General_Purpose_Timer_GPTIM.pdf
This document is about STM32G4. I do not know which MCU you have.
BR Klaus
2025-11-10 2:20 AM
Hello @Komal_Y and welcome to the ST community,
Please review How to write your question to maximize your chances to find a solution
Thank you
2025-11-10 4:36 AM - edited 2025-11-10 4:39 AM
Note, that feature mentioned by @mfgkw above (i.e. "invalid" transition detection, which is indicative of the phases being shorted together) is available in newer STM32 only, such as 'G4, 'H5 and 'U5 families. Look for TIMx_SR.TERRF flag in the RM.
It's hard to tell what would constitute "missing" phase - if the signal is not connected, this probably ought to be detected in some "analog" way, e.g. holding the signal at the board side at mid-level and using window comparator or ADC to detect that state. If a signal is "stuck" low or high, that's would result in position jumping forward and backward, detectable in software depending on the expected typical movement, but no automatic detection either.
JW