cancel
Showing results for 
Search instead for 
Did you mean: 

Disabling_SysTick timer

martindida
Associate II
Posted on October 18, 2012 at 08:59

Hi everybody.

I used SysTick timer as a counter of time in my application throug using of interruption. I found ''SysTick_Config'' function in core_cm0.h file. This function load time to reload register and switch timer and its interruption on and set interruption priority. When I wanted to switch SysTick timer off or at least its interruption in order not to be active. I found out there is no function for this purpose. I tried to look for this function almost everywhere in reference, in programming manual  also in help file, but I was not able to find it. So I am asking you. Are there such a functions for driving SysTick timer except that one or Shall I have to write my own.

Thanks for your help.                        kind regards   Martin
3 REPLIES 3
frankmeyer9
Associate II
Posted on October 18, 2012 at 09:48

You just need to reset bit 0 in SysTick->CTRL.

As it is basically intended as OS timer, the Peripheral_Lib designer saw probably no need in a disabling function.

Information can be found in the ''STM32F0xxx Cortex-M0 programming manual'', PM0215.

Don't know why it's not included in the reference manual.

martindida
Associate II
Posted on October 18, 2012 at 12:39

Thanks for your reply.

I know that fact. But when you switch SysTick timer on. It can happen that sometimes SysTick timer interruption would make malfunction of program running. So you would need to switch Systick timer interruption off at least. And that is not possible, when you do not written your own function.

frankmeyer9
Associate II
Posted on October 18, 2012 at 13:12

Sorry, but it's rather unclear to me what you mean.

 

I know that fact. But when you switch SysTick timer on. It can happen that sometimes SysTick timer interruption would make malfunction of program running.

 

That is the purpose of an interrupt, it happens with an event, and asynchronous to the normal program flow. Of course you need to consider this fact in your design.

And that is not possible, when you do not written your own function.

 

Surely you can put this bit set/reset operation in your own function.

So you would need to switch Systick timer interruption off at least.

 

I beg to disagree.

That would defeat the very purpose of this interrupt, which is an accurate timing.

Just keep the interrupt routine as short as possible, and write the rest of your code with the awareness that enabled interrupts can hit anywere.