Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

systick Vs Timer interrupt:Which one to use for generating periodic interrupts in ST

Status
Not open for further replies.

saochandan

Junior Member level 1
Joined
Mar 13, 2012
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,409
Hi all!

need to use one timer to generate a periodic interrupt to execute a particular set of codes.
I am using STM32F10x (cortexM3).

kindly explain what is the difference and advantages in using both and how to use them?


Thanks
 

Hello,

Systick can be use only in privileged mode and it is a 'core peripheral' so you do not need enable other clock or peripheral. (usefull for low power)
It is a native autoreload counter so it do not need the tipical init sequence to force a general purpose timer in autoreload mode.
I suggest you to use it, if your application run without a RTOS or scheduler.
 
Hello,

Systick can be use only in privileged mode and it is a 'core peripheral' so you do not need enable other clock or peripheral. (usefull for low power)
It is a native autoreload counter so it do not need the tipical init sequence to force a general purpose timer in autoreload mode.
I suggest you to use it, if your application run without a RTOS or scheduler.

Thanks Alex

Now I need to know how to configure systick timer. Suppose I want to generate interrupt from systick timer for every 0.50msec then what configuration and how i have to do?
 

It is very simple using Standard Peripherals Library and CMSIS

1) Include in your code:
Code:
if (SysTick_Config(SystemCoreClock / N))
{ 
  /* SysTick Config error */ 
  while (1);
}

where
-SystemCoreClock is your core frequency (defined in system_stm32f10x.c)
-N is IRQ frequency that you need (In case of 0.5 mSec you must set to 2000)


2)Include in your irq handler: (stm32f10x_it.c)
Code:
void SysTick_Handler(void)
{
  /* any code here will be execute every systick reload */
}

I hope this is usefull for you.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top