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 / 3613
3612  |  3614
Subject: 
Re: Sensor Power
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 6 Jan 2004 01:02:18 GMT
Viewed: 
3495 times
  
In lugnet.robotics.rcx.legos, Steve Hassenplug wrote:
ok, I have a real question.

I'm interested in sending messages between RCXs using only the sensor ports.

I've tested and found by switching between active and passive, signals can be
sent, however, when the port is set to active, it is not powered 100% of the
time (power is turned off to read sensor).

Is there a way to switch the power on, and keep it on, until I wish to switch it
off?

Also, I only want this change to affect one sensor port, not all three.

Take a look at the functions ds_power_on() & ds_power_off() as defined in the
dsensor.c kernel file.  When you've set the sensor to passive mode, you should
be able to manipulate the sensor power bits using these functions[1] or just use
the bit_set() and bit_clear() macros directly.

The bit numbering of the sensor ports is reversed in the hardware, so sensor
port 1 is bit 2, port 2 is bit 1, and port 3 is bit 0.

Finally, can someone tell me how long the sensor power is off, when reading an
active sensor?

Typically 30us, however, the 1ms system timer interrupt can block the sensor
interrupt handler from repowering the sensor for up to 550us!!![2]  If you're
using one of the suggestions that Joe Woolley or myself put forth on slowing the
sensor sample rate, then the 1ms timer interrupt won't be a problem, but you can
still have delays with the serial IR interrupt handler when sending & receiving
IR messages.

Mark

[1] I say "should" because I don't think I've ever tried this with BrickOS but
I'm basing this on a quick look at the dsensor.c file.  :-)

[2] When an LCD refresh operation *and* a task switch occur on the same 1ms
interrupt.



Message is in Reply To:
  Sensor Power
 
ok, I have a real question. I'm interested in sending messages between RCXs using only the sensor ports. I've tested and found by switching between active and passive, signals can be sent, however, when the port is set to active, it is not powered (...) (20 years ago, 5-Jan-04, to lugnet.robotics.rcx.legos)

2 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