cancel
Showing results for 
Search instead for 
Did you mean: 

Systick newbie question

gmotta2
Associate
Posted on December 07, 2009 at 17:57

Systick newbie question

2 REPLIES 2
gmotta2
Associate
Posted on May 17, 2011 at 13:33

I'm sorry my ignorance but I'm having a hard time understand how to calculate the reload value for the function SysTick_SetReload(x);

my clock is 32,000,000 and I would like to get an interrupt every 10ms

I just don't understand the formula. If anyone can tell me how this works I really apreciate it.

swhite
Associate III
Posted on May 17, 2011 at 13:33

The easiest way to setup the Systick is to use the SysTick_Config() function in the

http://www.st.com/stonline/products/support/micro/files/stm32f10x_stdperiph_lib.zip

. This function is located in the core_cm3.h header file. You provide, as the sole argument, the number of clock cycles you want between interrupts and it does the rest.

In your case you'd want 32,000,0000 * 0.01 = 320,000. Since the Systick timer is 24-bits, and this value is less that 2^24-1, it'll work.