2024-03-28 05:29 AM - edited 2024-03-28 05:38 AM
Hello all,
I am attempting to read the direction bit and have observed a surprising behaviour. Let’s say my encoder was set to the reverse direction. If I attempt to move the encoder in the opposite direction, the direction bit doesn’t update until I halt the movement.
just reading the value in the main loop
encoder_direction = (TIM3->CR1 & 0x10) >> 4;
Basically direction is not being updated on the move, Is this the intended behaviour of this bit?
2024-03-28 05:46 AM
TIM_CR1_DIR is for normal counter mode and not set in encoder mode.
2024-03-28 06:01 AM
2024-03-28 09:35 AM
Probably I am wrong. But maybe DIR is only visible internal. Can some ST insider confirm if DIR is set and readable in encoder mode?
2024-03-28 08:39 PM
@Uwe Bonnes Just to clear any confusion this is already running on my target, I am able to read the the bit but the behaviour is the issue.