2017-05-11 01:51 PM
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
Solved! Go to Solution.
2017-05-11 02:40 PM
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.
2017-05-11 02:40 PM
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.