Clock and Hardware Timer usage

Cedric Aubert cedric_aubert at yahoo.fr
Tue Jul 1 07:55:29 UTC 2003


Hi,

I have some question about the use of hardware timer
by RTEMS.

I read documentation (4.6.0pre2) of the timer, clock
and rtc.

To work, I have understand that :

- RTEMS need a tick OS (for example 10ms but hardware
timer can have 1ms or
less resolution).

- So the datation is based on the rtc and on the click
and tick, who are
based on the resolution of the
tick OS.( In the example 10ms so TimeofDay have the
resolution of 10ms).

- Software Timer (Timeout, Delay, Duration) are also
based on the click and
tick so on the resolution
of the tick OS (10ms in the example, so the timeout
can be at 10ms of
precision).

It's very classical usage of a timer with tick OS.

But I have some found some other possibility to use
the hardware timer, and
in fact I use a old RTOS with
other choice of use. Today this old RTOS don't have
timeslice, it's only
preemptive with system call.

- Old RTOS don't need a tick OS ( so no resolution of
time here, and so no
timeslice)
- For datation, each time we call a time fonction it's
read the hardware
timer so datation have a resolution of
the timer hardware (could 1ms or some us, more
precision without performance
degradation)
- For timeout or other software delay, we could have
the resolution of the
timer for the timeout but of course
for example, if you have a delay of 1us is too fast
but you can have a delay
of 1.875 ms with more precision and
without performance degradation)

I think it's possible to do this on RTEMS with a
second timer without many
change (use personnal fonction for
datation and timeout) but it's should be possible to
do both with only one
timer.

- RTEMS need a tick OS ( for example 10ms for
timeslice and other periodic
task)
- Datation can read timer for give timeofday so
datation should be at the
timer resolution not at the tick OS resolution.
- For timeout with a better precision than the tick OS
it's should possible
with deadline. I explain, if you have
tick OS timeout at 10ms with a hardware timer
precision of 1ms, if you want
a timeout at 25ms.
the hardware timer could be program the IT at 10ms for
tick number 1, after
program at 10 ms for tick 2,
after program at 5ms for the timeout, after program at
5ms for tick OS 3.
Need some Hardware Timer manager to
determine deadline time to program.

So, does anyone have do or working or just thinking
about this kind of
solution ?
I think it's a pretty good solution to have very good
time resolution
without degrade performance
on little CPU system (like mine of course) of don't
have to have a system
with a very little period
of tick and a very big number of IT/Sec.

Or may be it's already done, and I closed my eyes when
I read the
documentation.... :-)

Thanks for all

PS : Good luck to understand my english and my
confused mind. :-)

---
AUBERT Cedric
SDEL Controle Commande
Service R&D
rue Nungesser & Coli
44860 St Aignan de Grand Lieu

Tel : +33 (0)2 40 84 50 00
Poste : 5109
Fax : +33 (0)2 40 84 51 10

E-mail : cedric_aubert at yahoo.fr
Web : http://www.controle-commande.sdel.fr


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



More information about the users mailing list