After some software setup on the NXT side (The RobotC firmware must be burned to the NXT), I began by physically connecting the two devices. I did this by following the schematic referenced in my week 3 post, in which I fashioned a DIY connector after cannibalizing a sensor cable. My immediate goal is to establish simple communications, so I made my adapter pin-compatible to plug directly into the ChipKit itself.
A picture of my connector, note the 82KOhm pull ups soldered onto the header pins |
....and socketed into the ChipKit |
One really important thing is that the code posted on the dexter site seems to be designed for Arduino 1.0 or above. This is evident through the use of the v1.0 Wire.read() method, which is not available in the 022 libraries. Now the equivalent 022 method is Wire.receive(), which I've substituted into my code. Again this change is really important to note, because the ChipKit isn't talking with the NXT and I'm not sure why.
That brings us to the present, where I'm almost entirely certain that the messaging logic of my code is functioning correctly. My prediction is that some fault exists where I2C is handled, and thus I've hooked up my Saleae logic analyzer to the SDA/SCL lines. It appears that while the NXT it driving the SCL clock line correctly, there isn't any data being passed on the SDA data line. This indicates a fault with the NXT as the current RobotC code should initiate communications with an I2C packet addressed to the Arduino. However nothing is being sent, so here we are...
I'm going to continue analyzing the issue, until I can get the I2C into a working state everything is stuck on this.
http://www.dexterindustries.com/howto/connect-the-arduino-and-the-lego-mindstorms-together/