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 / 3087
3086  |  3088
Subject: 
Re: Interesting BrickOS Timing Results
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 15 Jan 2003 06:05:47 GMT
Viewed: 
2898 times
  
Joe,

That's definitely an improvement!  So, that would be a
250 Hz sample rate for any given sensor.  I just tried a
modification similar to yours that did all 4 conversions
every OCRA/B interrupt (or 1 KHz sample rate) and got:

IDLE: 82
2ROT: 77
NOAD: 93
NIRQ: 98

This sample rate should be more than enough for most
applications.  If someone needs a higher sample rate, then
there could be a system call to enable faster sampling.

Looking at the code in sys_time.c, it seems possible
that the OCRB interrupt could be consolidated with the
OCRA interrupt, freeing the OCRB interrupt to be
used for sample rates > 1 KHz.

Mark

"Joseph Woolley" <jwoolley@spamblock.insight.rr.com> wrote:

I retrieved the latest BrickOS from CVS, made clean and made the cpu
test program you listed.

I then made two small changes (to see what would happen); first the
results, then the changes:

IDLE: 89
2ROT: 87
NOAD: 91 (see below)
NIRQ: 98 (see below)

Ok, this looks promising, here is what I did.  This is the most simple
change I could think of on short notice  8-)

I commented out the line:
    bset #0x5,@_AD_CSR:8                ; go!
at the end of the ds_handler; so now the A/D convertion doesn't start up
again (yet)

Then I added the same line to the end of the systime_handler.  This
starts the A/D conversion every 1 msec.

OK, so this is not the end-all solution, but it is a good start IMO.
The interval should be user selectable (maybe) at run-time.  However,
the numbers are much higher with this simple change.  I would love to
test it with the rotation sensor at various speeds (motor x 1, motor x
2, x 3, etc..) to see how it performs in comparison with the original
method.  However, I don't have time right now.



Message has 1 Reply:
  Re: Interesting BrickOS Timing Results
 
(...) Timer B is usually unused but has a lower priority than Timer A. If you do a lot of stuff in the timer A routine, this will block timer B interrupts (especially if timer B generates more interrupts than timer A). The mean thing is that those (...) (21 years ago, 15-Jan-03, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: Interesting BrickOS Timing Results
 
Mark, I retrieved the latest BrickOS from CVS, made clean and made the cpu test program you listed. I then made two small changes (to see what would happen); first the results, then the changes: IDLE: 89 2ROT: 87 NOAD: 91 (see below) NIRQ: 98 (see (...) (21 years ago, 15-Jan-03, to lugnet.robotics.rcx.legos)

19 Messages in This Thread:






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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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