Clock and Hardware Timer usage

Cedric Aubert cedric_aubert at yahoo.fr
Wed Jul 2 15:12:54 UTC 2003


> It isn't for synchronization or precision.  It is to
> fire events that occur on second boundaries.  RTEMS
has
> interval based timers and wall-time based timers. 
Without
> updates to the wall-time side of the internal
timers,
> you won't trigger events.  For example, these two
services
> require this type of input:
>
>
http://www.oarcorp.com/rtemsdoc-current/html/c_user/c_user00078.html
>
http://www.oarcorp.com/rtemsdoc-current/html/c_user/c_user00137.html
>
> When a user actually obtains the time, it is OK to
get the
> at least the fractional portion of the system time
from
> hardware.
>
> > > Remember that RTEMS has "interval timers" and
"TOD
> > timers".

Ok for a software view but I speaking about the
hardware view :

You will have only one timer, with a varying HW
interval IT.

OK, we should have for RTEMS wall-time at least one of
this IT each second.

> That's OK for gets and sets but misses events
triggered from
> wall-time.

To me they should be like other timeout, programmed
with the
varying HW interval timer.

> Whatever portion of the TOD is obtained from the
> hardware timer should be the same regardless of
> hardware.  So there should only be two modes of
> operation -- fractional portion updated in software
> and fractional portion maintained in hardware.

Ok.

> > To my mind :
> >
> > - Read RTC only one time at boot up. -> Write RTC
> > Value to TOD ( at 1 sec )
> > - Should have at less a interrupt at a half of the
max
> > HW Timer Value (to
> > assume rollover). -> Update TOD ( at 0.5 Max value
)
> > - Write TOD by System -> Write TOD from param ( at
1
> > ns ), Write TOD to RTC
> > ( at 1 sec )
> > - Read TOD by System -> Read Current HW Timer
Value to
> > Update TOD ( at 1
> > timer step )
>
> This sounds right for a separate TOD timer except
the
> need to do something about the timer events that can
fire
> on 1 second boundaries.  The above gives you a
separate TOD
> timer which maintains an accurate TOD.
>

For me, no need of separate TOD Timer, using the same
varying HW interval
timer.

And for the Software Timer Events that can fire on 1
second boundaries, they
should use this same varying HW interval timer, with
other software timeout
in
a timer queue in fact.

I think, we confused some vocabulary about timer,
should be better to
precise
each timer if is a HW Timer or SW Timer. :-)

To me, hardware need to RTEMS for all software kind of
use :

- one varying HW interval timer
- one RTC

That all.

After you should have a Queue Timer Manager where SW
TimeSliceTimeout, SW
WallTimeTimeout and
SW UserTimeout are waiting to be programmed. Each IT
we had program the
shortest timeout of
all this one.

And TOD should be made with RTC Value and HW timer.
:-)


I think we are on the good way to understand each
other !! :-)))))

Cedric


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com



More information about the users mailing list