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 / 1246
1245  |  1247
Subject: 
Re: light sensor problem?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sun, 23 Jul 2000 18:38:46 GMT
Viewed: 
1779 times
  
On Fri, 21 Jul 2000, Kekoa Proudfoot wrote:
Luis Villa  <liv@duke.edu> wrote:
Ok, so i'm supposed to be the guru, but I don't get it: all my light
sensors are currently showing a range of adjusted values between 60-310,
instead of the 20-110 that I'm used to seeing. The sensor is in active
mode (passive mode still shows roughly 220-280, as usual) so I'm sort of
at a loss as to why I'm not showing the value I'm used to. Anyone? Anyone?
Luis

In active mode, the value you read from the light sensor depends on how you
power the sensor and read the A/D converters.  In particular, the delay
from the time you turn off the power to the sensor to the time you do A/D
conversion matters.  Has somebody changed the sensor charge or A/D
conversion code, or is there any reason to think the conversion time has
changed?

It has changed from 0.1.x- Markus (who seems to have just about
disappeared off the face of the planet) re-wrote a lot of that. On the
other hand, in the actual ds_handler function not much has changed: the
only thing that is apparent is that he added some code that claims to
"settle" the functions by doing a loop of "nop" (no ops, I presume). The
actual settling code is here:

---

   ; Added a delay loop for sensor settle time

   mov.b #0x04, r6h ; delay loop
settle:
   nop ; each nop is a 2 state clock delay
   dec.b r6h ; 2 states ?
   bne settle ; 4 states

   ; Total loop delay 32 states (?)

---

Additionally, two instructions are flipped earlier (so that the next
channel is stored after the sensor is turned off) which might make a very,
very slight difference in the timing but not much.

Would that "settling" time be what is affecting the output, Kekoa?

(an aside: what is the URL for the H8 assembly guide again? Anyone?)

I've tried to cut this code out and see what happens, but apparently
something else got screwed up last night that is affecting this. When that
is fixed, I'll try deleting the code and seeing what happens (particularly
if anyone who knows better thinks it will help.)

I don't know how LegOS does A/D conversion anymore.  It used to charge and
read the sensors in a strange way, and I forget if all the sensors were
treated the same or not.  Do the readings change if you move the sensor
from port to port?

No, it would appear that it is consistent for every light sensor. And
(last I checked) all the other "sensors" seemed to work fine, despite
(because of?) the settle time.

Thanks for your time, Kekoa...
Luis

-----------------------------------------------------------------------

    "Summertime... and the living is easy...
    fish are jumping and the cotton is high...
    So hush, little baby, baby don't you cry."
-Ella

-----------------------------------------------------------------------



Message has 1 Reply:
  Re: light sensor problem?
 
(...) Having fixed the other screwup, I can report that snipping the code I discussed earlier allows everything to build just fine. It doesn't, however, solve the issue with the light sensors. I also tried swapping the two lines I mentioned earlier: (...) (24 years ago, 23-Jul-00, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: light sensor problem?
 
(...) In active mode, the value you read from the light sensor depends on how you power the sensor and read the A/D converters. In particular, the delay from the time you turn off the power to the sensor to the time you do A/D conversion matters. (...) (24 years ago, 21-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