SysTick_Config

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SysTick_Config

3,418 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jlara on Wed Feb 02 19:29:10 MST 2011
Which of the following is correct?  I have seen it done both ways in the examples. 

SysTick_Config(SystemCoreClock/1000)
or
SysTick_Config(SystemCoreClock/1000 - 1)

Thanks in advance.
0 Kudos
3 Replies

3,101 Views
R3t0
Contributor II

Thanks for the explanation of the SysTick_Config() function. In the Clock Config Tools, the Systick Clock can also be set, what is the connection to the SysTick_Config() function here?

R3t0_0-1626267057904.png

 

 

3,209 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Albert on Wed Feb 02 21:24:10 MST 2011
Hi jlara,

Period = (RELOAD+1)/Clock -> RELOAD = Period*Clock-1.

If Period =10ms and clock = 100MHz
RELOAD = 10ms*100MHz - 1 = 999999.

But, the parameter on CMSIS funcion is RELOAD + 1

SysTick_Config(RELOAD + 1)

Then, for Period =10ms and clock = 100MHz we have:

SysTick_Config(999999+ 1) =  SysTick_Config(1000000) =  SysTick_Config(SystemCoreClock/1000)
0 Kudos

1,634 Views
SpoonMan
Contributor IV
Final result is wrong... 1e8 / 1e3 == 1e5 != 10e-3 * 100e6 == 1e8 / 1e2
Looks embarassing...
0 Kudos