RTEMS: Counting time, again... (help)

Stevens Brian BPSTEVENS at qinetiq.com
Fri Mar 26 13:59:41 UTC 2004


Alex,

The timer chip on PCs is capable of providing more than 1 clock pulse,
unfortunately only 1 is readily available and this is used by RTEMS (and
other OSs) to provide the clock pulse for the operating system.

On the i686 systems it should be possible to access the internal processor
timers (look at the clock code for the pc bsp). There is also an advanced
interrupt controller with timer function that is present on some boards /
chips. I was unable to find sufficient information to make use of this. 

All standard PCs have a real time clock chip and as well as providing the
time of day it can provide a periodic interrupt (IRQ10 on the PC). This
interrupt can be used within RTEMS and can provide a resolution of 122 Micro
seconds. 

I am in the process of developing an RTEMS device driver that makes use of
this. Currently it programmes the chip to generate an interrupt every 122
micro seconds and counts them and after the appropriate number will send a
signal to a posix thread.

A problem with any interrupt handling is that it takes processor time and by
having an interrupt so often the processor has less time for work.

If you are interested in the code then please let me know.

Brian Stevens

-----Original Message-----
From: Alex [mailto:kbyte at iol.pt]
Sent: 26 March 2004 10:57
To: Joel Sherrill
Cc: rtems-users
Subject: RTEMS: Counting time, again... (help)
Importance: High


Hi,

I know that will be some users that will say to me that this doubt is
already explain in the mailling list, but before sent this mail I search in
the mailling list and I saw nothings...

Weel, I need to measure time in microseconds (or nanoseconds, this will be
great). Using the posix calls the maximum resolution I get is 20
milliseconds. That doesnt feet my needs... :-(

So, I thinking to use an osciloscope or some device like that to measure
those times.
Another idea is to access the hardware ticks.

Which is the best way to measure those times? External counter device or
access hardware ticker?

Is there any free source code to access the hardware ticks?

Thanks in advance...

BSP: i686

Alex


____________________________________________________________________________
_______________
IOL Flash. A net normal em versao acelerada.
Precisa de uma caixa de correio maior? Com o IOL Flash pode ter uma caixa
com 21MB de espaco.
Saiba mais sobre o IOL Flash:
http://www.iol.pt/central_utilizador/iol_flash/

The Information contained in this E-Mail and any subsequent correspondence
is private and is intended solely for the intended recipient(s).
For those other than the recipient any disclosure, copying, distribution,
or any action taken or omitted to be taken in reliance on such information
is prohibited and may be unlawful.

Emails and other electronic communication with QinetiQ may be monitored.
Calls to QinetiQ may be recorded for quality control,
regulatory and monitoring purposes.



More information about the users mailing list