2022-07-02 01:35 AM
2022-07-03 01:50 AM
Code looks good, maybe your signals (hardware) aren't working as you expect. Observe GPIOA_IDR register in debugger, while toggling the pins (slowly turning encoder). Or, observe signals using oscilloscope directly on the mcu pin.
What hardware is this? Isn't it a Disco or EVAL board, where PA9 is loaded by the USB-VBUS capacitor?
JW
2022-07-03 02:21 AM
the board is a disco and I thought about that led cause the led does light up every time I turn the rotary encoder but I don't have an oscilloscope yet anyway. ill change to a different timer and see if that works. what's weird is there is a bit in TIMx->CR its a direction bit and last night I was playing with it and intermittently the bit would go to 1 indicating that the counter is down counting thanks for the advice tho im new to stm32 and programming for that matter
2022-07-03 01:30 PM
I changed to TIM5 and now its working nice now I just have to figure out how to tune the counter to my encoder so that one click adds 1 to the counter instead of like 4 or 5 at a time thanks for the response
2022-07-03 02:42 PM