External Input Counter and External interrupt : count the input signal from the button. 

So what is the different between two methods ?

While external interrupt needs to jump into the interrupt routine to do the increment or decrement of a variable,

counter can handle the job nicely without jumping anywhere with External Input Counter.

Therefore, it will be obviously useful when your program has many types of interrupt running. 

HAL_TIM_Base_Start(&htim2);    //Start TIM2 without interrupt

while (1)
{
  count = __HAL_TIM_GetCounter(&htim2);    //read TIM2 counter value
}

 

相关文章:

  • 2022-12-23
  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
  • 2021-11-21
  • 2022-12-23
猜你喜欢
  • 2022-02-16
  • 2021-07-24
  • 2022-12-23
  • 2021-12-03
  • 2021-12-16
  • 2022-12-23
相关资源
相似解决方案