STM32F4 Timer encoder mode
Good morning everyone,
I'd like some help on this problem.
On a WeAct BlackPill board equipped with STM32F411CEU6 I wrote a fairly simple program using the encoder mode on Timer2 to keep up with count and direction.
I activated the interrupt feature as well since I need to generate some signal base on certain counter value.
My problem is the HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim) that is call only half of the time.
I know this by a variable which is incremented every time the funcion is called and compare it the the counter value and is exactly half.
I put a breakpoint on HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim) and trace the code and notice that both interrupt flag of each input it's handled and the same CaptureCallback is called.
I know there are other ways to manage quadrature encoder but I thought since the feature it's available on the timer I could use it.
Before changing method I'd like to know if I am doing something wrong.
Thanks

