Name

Timers — Use of on-chip timers

System Clock

The eCos kernel system clock is implemented using the private timer of CPU0. By default, the system clock interrupts once every 10ms, corresponding to a 100Hz clock. This can be changed by the configuration option CYGNUM_HAL_RTC_DENOMINATOR which corresponds to the clock frequency. Other clock-related settings are recalculated automatically if the denominator is changed. If the desired frequency cannot be expressed accurately solely with changes to CYGNUM_HAL_RTC_DENOMINATOR, then the configuration option CYGNUM_HAL_RTC_NUMERATOR may also be adjusted. However, if this is done then CYGNUM_HAL_RTC_PERIOD must be changed to provide the described clock frequency.

The same Timer is also used to implement the HAL microsecond delay function, HAL_DELAY_US. This is used by some device drivers, and in non-kernel configurations, such as RedBoot, where this timer is needed for loading program images via X/Y-modem protocols and debugging. Standalone applications which require RedBoot services, such as debugging, should avoid use of this timer.

Timer-based profiling support

If the gprof package, CYGPKG_PROFILE_GPROF, is included in the configuration, then the MPCore global timer is reserved for use by the profiler.