Skip to main content
Visitor II
May 2, 2019
Question

TIM1_GetCounter() Results

  • May 2, 2019
  • 0 replies
  • 587 views

I have initialized TIM1 timer with:

TIM1_DeInit();

TIM1_TimeBaseInit(16, TIM1_COUNTERMODE_UP, 1000, 0);

TIM1_SetCounter(0);

TIM1_ITConfig(TIM1_IT_UPDATE, ENABLE);

TIM1_Cmd(ENABLE);

But calls to TIM1_GetCounter(); return the value 2. I can see the counter interrupt running and can increment a variable which provides an accurate enough timer, but I want to use the value of the counter, why does it always return 2? What am I missing?

    This topic has been closed for replies.