2014-02-06 03:08 AM
Hi,
I like to have a millisecond interrupt. I normally use one of the timer to create millisecond interrupt. But is there any advantage of using SysTick for millisecond interrupt? What is SysTick? Thank you John #stm32-systick #systick2014-02-06 04:27 AM
Hi
''What is SysTick?''SysTick is the timer that is built into the ARM Cortex M3/4 core. It is normally used to provide OS/RTOS clock for context switching or timing services. ''But is there any advantage of using SysTick for millisecond interrupt?'' Not sure. It may have advantages over peripheral timers in that it should be able to put the core into 'privilage' modes where as the peripheral timers probably cannot.2014-02-06 05:48 AM
Since it is bulid into the ARM architecture, it would make u independent from the derivate you´re using. It would be portable to every uC wich is based on ARM. This could be an advantage. So i guess, if i´d we writing something wich is supposed to work based on CMSIS and serve as an general starting point, i´d make use of the sys_tick, if no OS is supposed to be used.
2014-02-06 08:20 AM
It's also significantly less complex than a 1-4 channel TIM, so is likely to consume less power.
I'd use SysTick for a 1 ms timer.There are also buried TIM units in some of the STM32 which aren't connected to the outside world. I'd burn these first before using externally facing ones. Ultimately it depends on how many resources your project needs, as each timer has only one counting element.2014-02-06 02:11 PM
I posted a message on the forum several years ago. I have a 2ppm oscillator driving the STM32F2xx, and but I seemed to be get unusual drifting in timing. In the end what I found was that a 1ms SysTick is not the same as a 1ms Timer interrupt. The SysTick seemed to drift around a bit with a ''mind of it's own''. I never got to the bottom of it, but I suspect that SysTick might be derived (always) from the internal oscillator.
SysTick is easy to though. If you're happy to call them ''System Ticks'' - that's fine. If you're happy for them to occur every 1ms with about 99% accuracy - that's fine. If you need an accurate time (milli-seconds) reference then use a Timer!At least go through the exercise of comparing the two if accuracy is important.2014-02-06 02:24 PM
In some Cortex-Mx designs the SysTick can be clocked from a different source, here it's clocked from the same source as the processor and the peripherals, or 1/8 of it. Chances are it will not be clocked directly by the accurate HSE, but rather whatever the VCO/PLL is generating.
Not disclaiming your experience, but I'd expect SysTick to be synchronous with the timer clocks.Any DMA or Low-Power modes used with the system you observed this on?2014-02-06 09:53 PM
Hi Clive,
The datasheet is as you say, but my experience and doing delta's between SysTick and TIMx said otherwise. I'm not using any sleep modes (including WFI, WFE etc). I am using DMA's, so if there's something else I should know, then I'm certainly curious.When I compared TIMx (1kHz) to TIMy (6Khz) they were completely lock-step with each other over a 24 hour period.2014-02-06 10:02 PM
My previous post was at: