Page 1 of 1

connect the NTX with PIC18LF4550 via I2C

Posted: 22 Jan 2011, 07:25
by nichrist
I am trying to connect the NTX (master) with a PIC18LF4550 (slave) microcontroller via the I2C bus. NTX every 50ms writes to the I2C (first byte address, second register value) with a NI program using direct commands. I have tested the above program with the LEGO ultrasonic sensor witch use the I2C bus and I verify that it works fine.
For I2C clock and data interconnection I used the recommended 82K pull-ups resistors to the 4.5V provided by the NTX. Because the PIC is working with 3.3V I try also and connected the pull ups resistors to the 3.3V of the PIC supply voltage.
But PIC never achieve to identify his slave address transmitted by NTX (I set it to 0x02). With the NTX program I also change/sweep the transmitted address to all values up to 128 with no result. The only result that PIC records is a STOP bit (via its I2C STATUS register).
Only when enabling PICs I2C General Call Enable bit, PIC receives interrupt from the I2C due to a master transmission of a request. But also in this case PIC reads address 00 (and generates I2C interrupt) even if the address trasmited by the NTX is not 00.
I suspected that PIC don’t understands the ones transmitted by NTX or something like that.
Any suggestions?

Re: connect the NXT with PIC18LF4550 via I2C

Posted: 22 Jan 2011, 07:36
by timpattinson
Maybe posting the source of your program on the NXT brick and the PIC would help.
Also, I'm not an expert but the I2C interface implemented in the US sensor is a bit shaky so that is not proof that it works.
ps. no offence, but its NXT not NTX.
-Tim

Re: connect the NTX with PIC18LF4550 via I2C

Posted: 23 Jan 2011, 00:22
by aswin0
You might find some useful info in this thread.