Name
Timers — Use of on-chip Timer
Hardware Timer
The eCos kernel system clock is implemented using an on-chip
Timer. Depending on the device this will either be a Timer Counter, a
Simple Timer, or the Periodic Interval Timer. The kind of device used
is determined by the platform HAL. 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, and again clock-related settings will automatically be
recalculated.
The selected 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 with RedBoot
where this timer is needed for loading program images via X/Y-modem protocols
and debugging via TCP/IP. Standalone applications which require RedBoot
services, such as debugging, should avoid use of this timer.
Timer-based profiling support
Timer-based profiling support is implemented using timer counter 1 (TC1). If the
gprof package, CYGPKG_PROFILE_GPROF
, is included in the
configuration, then TC1 is reserved for use by the profiler.
2024-03-18 | eCosPro Non-Commercial Public License |