AW: finer resolution for RTEMS_CLOCK_GET_TICKS_PER_SECOND availible?

Joel Sherrill joel.sherrill at OARcorp.com
Thu Jun 19 15:46:36 UTC 2008


Detlev Schuemann wrote:
> Hello,
>
> there is a high resolution timer in timerdrv.h.
>
> You can use the directives:
>
> Timer_initialize() and Read_timer()
>
> They are used in some testsuites.
>   
Good thought but wrong.  These are only to be used in
the timing tests.

It is better to have the BSP support the nanoseconds
since last tick hook and just use regular clock calls.

This was added in 4.8 and any POSIX call which gives
back a seconds/nanoseconds structure is accurate.
On the CVS head, there are also calls like rtems_clock_uptime
and others with micro or nano second granularity.

Look through the Clock Manager chapter for CVS RTEMS:

http://www.rtems.org/onlinedocs//doc-current/share/rtems/html/c_user/c_user00103.html

I think you will find that you want the microseconds per
tick value to be something reasonable like 1 tick per millisecond
to reduce interrupt overhead and then make sure your BSP supports
the nanoseconds since last tick extension.

--joel
> Regards
>
> Detlev
>
> -----Ursprüngliche Nachricht-----
> Von: rtems-users-bounces at rtems.org [mailto:rtems-users-bounces at rtems.org] Im
> Auftrag von Christian Poessinger
> Gesendet: Donnerstag, 19. Juni 2008 16:48
> An: rtems-users at rtems.com
> Betreff: finer resolution for RTEMS_CLOCK_GET_TICKS_PER_SECOND availible?
>
> Hallo,
>
> my i386 based system reports me 100 ticks per second when invoking
> rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND , &ticks_persecond );.
>
> I want to count times in the range of microseconds so I can't use the
> rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT , &ticks_start ); call.
>
> Is there any method in RTEMS to count in micro seconds, like a high
> precision timer? When defining CONFIGURE_MICROSECONDS_PER_TICK 1 the
> system and my for-loops go crazy.
>
> Best Regards,
> Christian
>
>
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>   


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985





More information about the users mailing list