Page 1 of 1

How long is a System Tick ?

Posted: Sun Dec 01, 2013 11:20 pm
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

Re: How long is a System Tick ?

Posted: Mon Dec 02, 2013 9:35 am
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