How to reverse the counting direction using a Timer in Encoder Mode.
I'm using an STM32 to control a DC motor with a dual hall encoder feedback.
To monitor motor position I want to use a General Purpose Timer (16bits) in Encoder Mode.
The configuration is going well but I notice that the logic is reversed:
- When the motor is going forward, the TIM Counter goes down.
- When the motor is going backward, the TIM Counter goes up.
I could fix this issue by flipping the wires, but I would prefer just changing a HAL configuration. Using CubeMx I tried to change the count direction settings without success (the behaviour stayed the same).
Is there a way to flip the timer counter logic?
Your help is appreciated.
