Skip to main content
Associate III
May 11, 2026 11:38 AM UTC
Question

STM32 Encoder Mode vs Remap CH1, CH2 vs Index Mode

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!

3 replies

waclawek.jan
Super User
May 11, 2026 2:56 PM UTC

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.

waclawekjan_0-1778511385009.png

 

JW

Associate III
May 12, 2026 6:43 AM UTC

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? 


waclawek.jan
Super User
May 12, 2026 1:59 PM UTC

> 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