cancel
Showing results for 
Search instead for 
Did you mean: 

Pause a systick timer in cortex m3

Muzahir Hussain
Associate III
Posted on December 02, 2017 at 17:29

Is there a way to pause systick timer in cortex m3. Disabling/Enabling the timer doesn't pause it, but causes it to stop and restart. I want to pause the systick timer. Is there any way to do this?

#systick #cortex-m3 #keil #stm32-f
3 REPLIES 3
Posted on December 02, 2017 at 19:01

I want to pause the systick timer. Is there any way to do this?

By setting/clearing STK_CTRL.ENABLE.

Disabling/Enabling the timer doesn't pause it, but causes it to stop and restart.

How do you know?

JW

Posted on December 03, 2017 at 11:40

Because I've tried that. Once I enable STK_CTRL.ENABLE bit after disabling, it starts all over again

Posted on December 03, 2017 at 21:56

Because I've tried that. Once I enable STK_CTRL.ENABLE bit after disabling, it starts all over again.

How exactly did you try that? Didn't you use some library function? And how did you verify that it starts over?

I'm asking because the ARM v7M ARM in B3.3.1 SysTick operation says something different:

When enabled, the timer counts down from the value in SYST_CVR

There's even a warning later that SYST_CVR's content after reset is undefined thus user after setting SYST_RVR should explicitly zero SYST_CVR  (by writing anything into it) before enabling, to assure the first period will last as expected.

JW