To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 2520
2519  |  2521
Subject: 
Re: sys_timer
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Fri, 3 May 2002 07:05:51 GMT
Viewed: 
2417 times
  
On Fri, 3 May 2002, Samuel Winchenbach wrote:

I recently adopted legOS as my development environment and I have to say I
tremendously impressed.  Thanks to everyone who has worked so hard on it.
It is really a first class, grade A product.

Is sys_timer accurate to within 1 ms?

Yes. It is updated from an interrupt routine that fires every 1 ms (IIRC).
However....

    unsigned long timer_str;
    time_str = sys_time;
    wait_event(... );
    time_str = sys_time - time_str;
    lcd_int((int)timer_str);

wait_event is only accurate to 20ms or so, depending on what your other
tasks do. So your timing is very accurate, but you're not timing what you
think you're timing. I seem to recall there being a thread a month or two
back which discussed how to time events more accurately, and if you really
need better than 20ms accuracy, you should find some good tips there.

--
"From now on, we live in a world where man has walked on the moon.
And it's not a miracle, we just decided to go." -- Jim Lovell

Mike Ash - <http://www.mikeash.com/>, <mailto:mail@mikeash.com>



Message is in Reply To:
  sys_timer
 
I recently adopted legOS as my development environment and I have to say I tremendously impressed. Thanks to everyone who has worked so hard on it. It is really a first class, grade A product. Is sys_timer accurate to within 1 ms? unsigned long (...) (22 years ago, 3-May-02, to lugnet.robotics.rcx.legos)

4 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR