cancel
Showing results for 
Search instead for 
Did you mean: 

SysTick_CALIB, What does it do??

trprovencal
Associate
Posted on April 05, 2013 at 01:35

Using the STM32L152RB....

So I know that the value stored in the SysTick_CALIB register is the value that must be loaded into SysTick_LOAD in order for the ticker interrupts to have a delay of 10ms (as stated in online reference manuals), but I'm confused as to what SysTick_CALIB actually does... Is it just a reference value that the programmer must check depending on their code? Does it load this CALIB value into LOAD by default? Does the value change depending on which system clock is used?

My colleagues and I are just confused and curious at this point, we feel like the fact that it's called a ''calibration'' value implies that the board itself must use this value at some point, whether to correct clock errors or something of that nature. Anyone have any knowledge on this?

Thanks for any input!
4 REPLIES 4
Posted on April 05, 2013 at 02:04

Depends on what's defined in the other bits, saying if there is an external source, and if the calibration value is valid.

It is basically there to provide information about a fixed clock source external to the core, from which other delay values can be computed.

ie

SYSTICK_RELOAD

=

((

SYSTICK_CALIB

*

usec

) /

10000)

-

1

;

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
trprovencal
Associate
Posted on April 05, 2013 at 06:07

Still kinda confused... it provides information from which clock? Does the processor check if there is an external clock and change those leading bits correspondingly, then update whether or not the calibration value is valid for that clock?

crt2
Associate II
Posted on April 05, 2013 at 10:28

clive1 did write you that it depends what other bits are setting - just calib is not setting anything directly but it is used when you want to get a reference or sync with external clock (if I simplify it) source

Posted on April 05, 2013 at 13:39

Ok, you need to think like an IC designer, not a software engineer.

The core can run from many different clocks, at a multitude of frequencies, many of these will be unknown, might change, and might be dependent on crystals attached externally to the part, and can have quite a significant range. In order to solve for the unknowns, you must have something you know.

The purpose of this register is for the IC designer to burn in a particular value, from a known and fixed external source he has attached, that is independent of the one clocking the core. It might be significantly slower than the core's clock, say 32.768 KHz, 40 KHz, or the 1 MHz comparison frequency used by the PLL. It might not even be implemented, see NOREF bit.

http://books.google.com/books?id=5OZblBzjsJ0C&pg=PA185&dq=systick_calib+noref&hl=en&sa=X&ei=XLdeUZ_6F4aZqgGJh4GoCw&ved=0CDEQ6AEwAA#v=onepage&q=systick_calib%20noref&f=false

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..