Timer resolution et al

sashti srinivasan svasn_rtems at yahoo.com
Wed Mar 10 05:33:41 UTC 2004


Hi,

    Thanks for one important information, that rtc
chip interrupts the processor ~122 microseconds.  I am
able to get 10 microsecond accuracy without going to
hardware.  Please correct me if I am wrong.  I
configured the CONFIGURE_MICROSECONDS_PER_TICK to 10
microseconds and hoping that it is giving with 10
microseconds accuracy on pc386.  Am I wrong?  Please
tell me.

     I am also working on PC386 BSP.  One thing coming
to my mind, we have a bios whose services can be made
effective use of.  Is there any service in bios that
gives 1 microsecond accuracy?

      Various timing tests that are distributed with
rtems did not run on PC386.  Mr.Joel also wanted to
know whether anyone got them working on PC386.  Have
you got them working?  I am not sure, but I think the
problem is only with timer
driver(c/src/lib/libbsp/i386/pc836/timer/timer.c). 
The timing tests make use of timer functions
Timer_initialize() and Read_timer().  Probably these
functions cause the problem.

      Hardware:  Probably the best place to know about
hardware is rtems source code.  In the above mentioned
file, the function rtdsc() is probably giving time
from hardware.  It is a short function counting to
less than 5 lines.  I could not understand the most
important line in this.  That is:
    asm volatile(".byte 0x0F, 0x31" : "=A" (result));
  I referred to the gnu documentation for gcc.  Only
things I found out was, "=" specifies result is a
output,"A" specifies some attributes of result.  But
as per the documentation, the string preceding :
should contain a instruction mnemonic.  I do not
understand the presence of assembler directive .byte
as the part of the string.  Sorry for troubling the
members of the list with doubt unrelated to rtems. 
Thanks if anyone can explain this to me.

With Regards
Srinivasan
--- Stevens Brian <BPSTEVENS at qinetiq.com> wrote:
> I have been following the thread on timer resolution
> etc as I have a need
> for the following:
> 
> 	A timer with an accuracy of sub milliseconds
> 	A timer that is not dependant on the underlying
> clock tick.
> 
> I am working with the pc386 port and have formulated
> some ideas:
> 	Use one of the other counters on the timer chip.
> 		This seems a straight forward way to do the job
> without
> altering the existing code, and since most timer
> chips have more than 1
> counter it could probably be extended to other
> ports. However, it seems that
> the other timer outputs are not normally conected to
> the interrupt
> controller. 
> 
> 	Use the real time clock
> 		In the PC the real time clock chip can provide a
> periodic
> interrupt with a resolution of ~122 micro seconds
> and this line is connected
> to the interrupt controller.
> 
> I would prefer to go with the 1st method as I think
> that this would have
> more generall application. If any one can help me
> with the hardware parts
> then I am willing to have a go at the code for the
> pc386. (this is a home
> job not a work job so it may take some time)
> 
> Thank You
> 
> Brian Stevens
> 
> QinetiQ
> Cody Technology Park,
> Ively Road,
> Farnborough,
> Hampshire
> GU14 0LX . 
> UK
> 
> Telephone (01252) 393959
> Fax          (01252) 395120
> 
> 
> 
> 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.


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com



More information about the users mailing list