cancel
Showing results for 
Search instead for 
Did you mean: 

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

John123
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Many thanks.