AnsweredAssumed Answered

Encoder overflow or underflow?

Question asked by Raul Galbany on Feb 17, 2018
Latest reply on Feb 19, 2018 by waclawek.jan

Hello,

I configured the TIMER1 to use like an encoder counter. My question is: How I can detect inside the in the interrupt function if the interrupt was caused by an overflow or underflow in the counter?

 

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)

{

   if(htim == &htim1)

   {

    HAL_GPIO_TogglePin(Led_Groc_GPIO_Port, Led_Groc_Pin);

   }

}

Thanks!!!

Outcomes