cancel
Showing results for 
Search instead for 
Did you mean: 

SysTick discrepancy compared to regular timers

e d
Associate II
Posted on May 11, 2017 at 22:51

I am using the STM32L437 part and I run into some confusion with SysTick. I set up the SysTick to run at 1ms with timer 5 as Timebase source (for comparison). As a sanity check, I also set up timers 3, 4, 6 and 7 independently at 1ms as well, thinking they would all match up pretty closely but the results for SysTick and timer 5 are a bit different from the other 4 timers. In this test code I only use one clock source at a time (either internal OR external, no mixing... when using internal clock source the difference is even more pronounced). As you can see here the SysTick and timer 5 show 2669 seconds elapsed, but the other 4 regular timers show 2612 seconds, a difference of 57 seconds. Does SysTick run on a different clock than the other timers? Is there anything special about SysTick compared to other timers that I am not aware of. Thanks!

ED

0690X00000606x4QAA.png
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on May 11, 2017 at 23:40

Prescaler and Period values for timers are programmed as N-1, people frequently program them wrong and get slower time (longer periods)

TIMs and SysTick should all share a common synchronous clock source.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

1 REPLY 1
Posted on May 11, 2017 at 23:40

Prescaler and Period values for timers are programmed as N-1, people frequently program them wrong and get slower time (longer periods)

TIMs and SysTick should all share a common synchronous clock source.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..