How long is a System Tick ?

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
eribla
Posts: 20
Joined: Fri Nov 29, 2013 1:10 am

How long is a System Tick ?

Post by eribla »

Hi
This is a newbie question, but I could not find an answer.

I found the definition for system tick below, and I know that a virtual timer works on system ticks.
but how is the system Tick related to the MCU (STM32F4) frequency?

Would I change this definition below (in chconf.h) depending on my CPU quartz used?

Thanks


/**
* @brief System tick frequency.
* @details Frequency of the system timer that drives the system ticks. This
* setting also defines the system tick time unit.
*/
#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__)
#define CH_FREQUENCY 1000
#endif
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: How long is a System Tick ?

Post by Giovanni »

Hi,

The above definition is independent from the quartz frequency and system frequency, those details are resolved in other layers:
- In board.h there is the external clock frequency.
- In mcuconf.h there are the clock tree settings.

All the other clocks are calculated automatically from the the above, including the system tick.

Giovanni
Post Reply