Problem with SPLIT-Nx

Questions/Discussions relating to software and programming of sensors, controllers and actuators for NXT.

Problem with SPLIT-Nx

Postby ChrisB » Sun Jan 31, 2010 7:02 am

I am trying to use the SPLIT-Nx to allow a ultrasonic sensor and a mindsensors accelerometer (v2) to co-exist on one port. I have changed the address of the accelerometer to 2 and my testing program works with both sensors independently. However when connected at the same time only the ultrasonic sensor connects. I have included my program below. Can anyone help?

Thanks,

Chris

Code: Select all
import lejos.nxt.Button;
import lejos.nxt.LCD;
import lejos.nxt.SensorPort;
import lejos.nxt.UltrasonicSensor;
import lejos.nxt.addon.TiltSensor;

public class SensorMuxTest {

   public static void main(String[] args) throws InterruptedException {
      LCD.clear();

      TiltSensor tiltSensor = new TiltSensor(SensorPort.S1);
      tiltSensor.setAddress(0x02);
      tiltSensor.sendData(0x41, (byte) 0x4E); // ADPA On
      Thread.sleep(100);

      UltrasonicSensor ultrasonicSensor = new UltrasonicSensor(SensorPort.S1);

      LCD.drawString("T " + tiltSensor.getSensorType(), 0, 0);
      LCD.drawString("  " + tiltSensor.getProductID(), 0, 1);
      LCD.drawString("  " + tiltSensor.getVersion(), 0, 2);

      LCD.drawString("U " + ultrasonicSensor.getSensorType(), 0, 3);
      LCD.drawString("  " + ultrasonicSensor.getProductID(), 0, 4);
      LCD.drawString("  " + ultrasonicSensor.getVersion(), 0, 5);

      LCD.refresh();

      while (!Button.ESCAPE.isPressed()) {
      }
   }

}
ChrisB
 
Posts: 5
Joined: Wed Jun 17, 2009 5:55 am

Re: Problem with SPLIT-Nx

Postby support » Sun Jan 31, 2010 6:23 pm

The Ultrasonic address is also 0x02.
Change the address of acceleration sensor to something else (say 0x04).
support
 
Posts: 104
Joined: Fri Sep 25, 2009 12:54 pm

Re: Problem with SPLIT-Nx

Postby ChrisB » Sun Feb 21, 2010 4:50 pm

I have changed the address as you suggested but I am getting a I2C Error when trying to send the "ADPA On" command. What exactly is ADPA and do I have to turn it on every time I use the sensor or just once.

Chris
ChrisB
 
Posts: 5
Joined: Wed Jun 17, 2009 5:55 am

Re: Problem with SPLIT-Nx

Postby support » Mon Feb 22, 2010 7:24 am

Use shortest possible wires to minimize the capacitance of the system. (generally I2C errors are related to wire lengths and capacitance that causes).
With short wires, can you get the readings without sending ADPA ON command?
support
 
Posts: 104
Joined: Fri Sep 25, 2009 12:54 pm

Re: Problem with SPLIT-Nx

Postby ChrisB » Mon Feb 22, 2010 12:58 pm

I am afraid it is still not working. I tried using short wires with the ADPA command and without. Would I have more luck with two mindesensors sensors (Like a line leader and a Accelerometer)?
ChrisB
 
Posts: 5
Joined: Wed Jun 17, 2009 5:55 am

Re: Problem with SPLIT-Nx

Postby ChrisB » Tue Mar 16, 2010 4:57 pm

Talking to a lejos developer this problem is now fixed. Thanks for your advice.

Chris
ChrisB
 
Posts: 5
Joined: Wed Jun 17, 2009 5:55 am

Re: Problem with SPLIT-Nx

Postby mightor » Wed Mar 17, 2010 3:41 am

Can you elaborate on the cause of the problem so that others can learn from it?

Thanks,
Xander
| Spanish Siamese twins for sale. Buy Juan get Juan free. Call now!
| Current projects and ramblings: I'd Rather Be Building Robots
| RobotC 3rd Party Driver Suite: [Project Page] / [API Documentation]
mightor
 
Posts: 46
Joined: Thu May 28, 2009 11:50 am

Re: Problem with SPLIT-Nx

Postby ChrisB » Sun Apr 11, 2010 5:57 am

I just use lejos and don't write the firmware, according to gloomyandy on the lejos forums with "pretty big changes to i2c" it now works. You can view the original thread here.

Chris
ChrisB
 
Posts: 5
Joined: Wed Jun 17, 2009 5:55 am


Return to Software and Programming

Who is online

Users browsing this forum: No registered users and 1 guest