This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Ticks resolution
- To: ecos-discuss at sourceware dot cygnus dot com
- Subject: [ECOS] Ticks resolution
- From: Cristiano Ligieri Pereira <cpereira at ics dot uci dot edu>
- Date: Wed, 28 Mar 2001 09:47:17 -0800 (PST)
Hi everybody,
I would like to understand better how the RTC works in eCos. I'm currently
using i386 platform. In the file hal_i386_pc.h I see the definition of
three constants :
#define CYGNUM_HAL_RTC_NUMERATOR 1000000000
#define CYGNUM_HAL_RTC_DENOMINATOR 100
#define CYGNUM_HAL_RTC_PERIOD 11932
According to the documentation, I've seen that numerator over denominator
gives me the duration between two 'ticks' in nanoseconds. So for these
definitions, one can see that between two ticks we have 10,000,000
nanoseconds or 10 miliseconds. Or in other words 100 ticks per
second. Right?
What if I wanna have more resolution. What should I do to delay some task
for less than 10 miliseconds? Lets say 1 milisecond. Should I just modify
the numerator to 100,000,000 (divide the define value by 10) and
recompile. If so, how far can I go with this?
In the same file there is a comment like this:
/*
Not really sure exactly how these are used... but the RTC period is
based on the clock input to the 8254, which is 1193180Hz.
CYGNUM_HAL_RTC_PERIOD is set for 100 ticks per second.
Note also that the real-time clock stuff is a bit misleading: this only
configures the interval timer; we have another actual real time clock
instead.
*/
I'm also not sure about how all this works. Can someone clarify it to me,
please?
thanks a lot in advance,
Cristiano.
------------------------------------------------------------
Cristiano Ligieri Pereira - http://www.ics.uci.edu/~cpereira