Skip to main content
Visitor II
May 6, 2024
Solved

Query regarding HAL_GetTick() - what happens when SysTick timer rolls over through zero?

  • May 6, 2024
  • 1 reply
  • 1395 views

Hi - I'm using HAL_GetTick(), and then subtracting one value from another to determine a GPIO input pulse width.

What happens if I happen to to call HAL_GetTick() around the point where the SysTick timer rolls over through zero.

Do I need to watch out for this situation generally?

Regards, John.

    This topic has been closed for replies.
    Best answer by Peter BENSCH

    Yes, you have to consider this problem. Typically, this is only used to determine time differences to a previously saved value, which eliminates the problem, as discussed here, for example.

    Hope that helps?

    Regards
    /Peter

    1 reply

    Technical Moderator
    May 6, 2024

    Yes, you have to consider this problem. Typically, this is only used to determine time differences to a previously saved value, which eliminates the problem, as discussed here, for example.

    Hope that helps?

    Regards
    /Peter

    John123Author
    Visitor II
    May 6, 2024

    Many thanks.