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 / 1291
1290  |  1292
Subject: 
Re: light sensor problem?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 25 Jul 2000 16:45:40 GMT
Viewed: 
1930 times
  
Luis Villa  <liv@duke.edu> wrote:
On Mon, 24 Jul 2000, Eddie C. Dost wrote:
and (maybe) inproper driving of the sensors (See Kekoa's comments
in e-mails last year).

I'm not sure which comments you are referring to- do you have a URL for
the lugnet post?

I personally forget the numbers of the lugnet posts.

The gist is that the firmware and LegOS were, at the time, different in a
critical way.  I don't know the current status of LegOS.

At the time, LegOS cycled through the 4 A/D sensors, reading each in
sequence at a rate of about 1 every 0.1 ms.  The firmware read all 4 every
3 ms.

The main difference was the way power to the sensors was managed.  When
reading sensors, the firmware turns off power to the sensors, does some
other stuff, then starts A/D conversion.  This is all in the 36ba OCIA
handler: "set port 6 bits 0, 1, 2 to low" and later "start a/d conversion".
The delay is important and is there to make sure the sensor values have
time to settle before the A/D conversion starts.

LegOS, on the other hand, turned off power immediately before starting A/D
conversion.  I had coded this outside of LegOS and had troubles with it;
adding a short delay fixed it.  The delay was implemented in C as:

int i;
for (i = 0; i < 5; i++);

Somebody maybe raised the complaint that this delay shouldn't be in the
interrupt handler.  What about turning off the power to sensor x while
reading sensor x-1, then turning off power to sensor x+1 while reading
sensor x.

The concern about this was that perhaps the sensors would not have enough
time to charge.  The sensors would only get .2 ms to charge before being
off for .2 ms to be read.  It was also questioned whether the then-current
scheme of charging the sensors for .3 ms and reading for .1 was
problematic.  Nobody ever showed (with a scope) that either was problematic
though.

That sensors are cycled read one every .4 ms rather than all four every 3
ms seems nice, but I think this is only the case if somebody shows it gives
identical results to the firmware (modulo the faster reads).

Maybe I will finish with a reminder that the firmware is very well
documented, although at a very low level.  If a feature of LegOS is ever
broken or strange, you can always look at the firmware docs if you like to
see how things are "supposed to be done" so you can at least compare to
something that is known to work.

-Kekoa



Message has 2 Replies:
  RE: light sensor problem?
 
(...) And I'll add the reminder (for all the newbies) that without Kekoa's efforts in doing the low-level documentation, we would not be where we are today.... Thanks again, Kekoa....... As a side note, I wonder how the power to the LCD controller (...) (24 years ago, 25-Jul-00, to lugnet.robotics.rcx.legos)
  Re: light sensor problem?
 
(...) Can you please tell me where to find this documentation? Mike (24 years ago, 27-Jul-00, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: light sensor problem?
 
(...) :) Bad is, of course, all relative... (...) Yes, though IMHO fast = good. It allows us to do things with legOS that might not be doable with other firmwares. (...) I'm not sure which comments you are referring to- do you have a URL for the (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)

26 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