2026-05-11 4:38 AM - last edited on 2026-05-11 4:43 AM by mƎALLEm
Hi,
I am using two rotary encoders on an STM32U5G9ZJT.
Currently I have:
- TIM8_CH1 and CH2 available
- TIM3_CH3 and CH4 available
I know that standard encoder mode uses CH1 and CH2.
CubeMX shows options like:
- Encoder Mode (with remap CH1/CH2)
- Encoder Mode + Index (with remap CH1/CH2 + ETR)
My encoders are simple mechanical rotary encoders.
Question:
Should I use "Encoder Mode with remap" to map CH3/CH4 to CH1/CH2,
or is there any benefit to using "Encoder Mode + Index"?
Is there any difference, If I use "TIM8 in encoder mode" or "TIM3 encoder mode from remap"
Thanks!
2026-05-11 7:56 AM
There's no point using the "Encoder+Index" mode if you don't have an encoder with an index output.
You cannot use TIMx_CH3/CH4 for Encoder. Fullstop.
JW
2026-05-11 11:43 PM
Thanks for your answer,
You mean that the "Encoder Mode with remap" does not mean that we can use CH3 and CH4 for the quadrature encoder inputs, did I understand correctly?
So, may I ask, what does "Encoder Mode with remap" means?
2026-05-12 6:59 AM
> what does "Encoder Mode with remap" mean?
I don't know. There is no such expression in the Reference Manual nor Datasheet for the 'U5. My guess is you have it from CubeMX. I don't use Cube/CubeMX. Cube/CubeMX developers sometimes "invent" terminology which does not match the chips' documentation. You may want to review CubeMX documentation. Or maybe somebody who uses Cube/CubeMX will chime it with the explanation.
In the ancient 'F1 family, there was this "remap" concept related to which pin pair was assigned to TIMx_CH1/CH2, but in all other families, there's no such concept.
JW
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.