Hardware Reference
In-Depth Information
tick
lifetime
1ms
50 days
5ms
8 months
10 ms
16 months
50 ms
7 years
Table 10.1
System lifetime for some typical tick values.
10.4
MISCELLANEOUS
10.4.1
TIME MANAGEMENT
To generate a time reference, a timer circuit is programmed to interrupt the processor
at a fixed rate, and the internal system time is represented by an integer variable, which
is reset at system initialization and is incremented at each timer interrupt. The interval
of time with which the timer is programmed to interrupt defines the unit of time in the
system; that is, the minimum interval of time handled by the kernel (time resolution).
The unit of time in the system is also called a system tick .
In DICK, the system time is represented by a long integer variable, called sys clock ,
whereas the value of the tick is stored in a float variable called time unit .Atany
time, sys clock contains the number of interrupts generated by the timer since sys-
tem initialization.
unsigned long
sys clock;
/* system time
*/
float
time unit;
/* unit of time (ms)
*/
If Q denotes the system tick and n is the value stored in sys clock , the actual time
elapsed since system initialization is t = nQ . The maximum time that can be rep-
resented in the kernel (the system lifetime ) depends on the value of the system tick.
Considering that sys clock is an unsigned long represented on 32 bits, Table 10.1
shows the values of the system lifetime for some tick values.
The value to be assigned to the tick depends on the specific application. In general,
small values of the tick improve system responsiveness and allow handling periodic
activities with high activation rates. On the other hand, a very small tick causes a large
runtime overhead due to the timer handling routine and reduces the system lifetime.
Search WWH ::




Custom Search