STM32F103 Timer Encoder mode interrupt callback PeriodElapsed not firing
- April 21, 2020
- 12 replies
- 9632 views
STM32F103 MCU , CubeMX generated code for Atollic True studio.
TIM1 configured in Combine Channel -> Encoder Mode , User Parameter ->EncoderMode -> Ti1 and Ti2 , NVIC Settings -> TIM1 Update Interrupt enabled.
HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) - method implemented in main.c
contains only a GPIO LED toggle
main() method contain timer init generated code and timer start call
HAL_TIM_Encoder_Start_IT(&htim1,TIM_CHANNEL_ALL);
Also contains methods to print encoder counts.
As the encoder is turned, encoder counts are printed, but when the Counter period ARR - value over flows the interrupt is not fired.
Is period elapsed the correct call back? do i need to do something more?
I tried with TIM4 similar setting enabled global interrupt, but same results, encoder count is printed but overflow / underflow interrupt is no called.
Any suggestions?
Regards
Samit
