Page 7 of 7

Re: Custom I2C sensor problem

Posted: 27 Jan 2011, 15:32
by aswin0
I added inline resistors when testing with the bus pirate. The bus pirate wouldn't work with these resistors. So the inline resistors seem to be a problem indeed and the level shifter isn't the solution.

I had only one option left. Soldering over the inline resistors in the NXT, and so I did.

Succes!!!!

The IMU works!

So, this is the proof, it were the inline resistors that prevented the NXT to talk to the IMU. It took me a month to find out. It is a pity though that I didn't find another solution, one that all might benefit from. I wonder why lego has placed these resistors there in the first place.

Now I will try to get rid of the level shifter all together, and then I will try to put the hardware in a lego sensor housing. In the mean time I will write a driver for the IMU.

I want to thank everybody for their help and moral support. Thanks!

Re: Custom I2C sensor problem

Posted: 27 Jan 2011, 16:01
by mightor
Wow, so you had to modify your NXT to make this work? Sounds like a pretty desperate thing to do, I guess you *really* want that IMU working :)

- Xander

Re: Custom I2C sensor problem

Posted: 27 Jan 2011, 16:20
by philoo
aswin0 wrote:I had only one option left. Soldering over the inline resistors in the NXT, and so I did.
Now take care with that port! since regular I2C sensor are 5V powered, you might either fry NXT arm inputs that are only 3.3V tolerant, the protection diode of the port, or your sensor trying to drive current through this diode. I agree that most probably nothing bad will happen, but I'd nonetheless avoid that...
Did you try a bus repeater chip such as PCA9515A? (OK, I should re-read the complete thread since answer is probably there...)

Re: Custom I2C sensor problem

Posted: 27 Jan 2011, 16:22
by philoo
aswin0 wrote:I had only one option left. Soldering over the inline resistors in the NXT, and so I did.
Now take care with that port! since regular I2C sensor are 5V powered, you might either fry NXT arm inputs that are only 3.3V tolerant, the protection diode of the port, or your sensor trying to drive current through this diode. I agree that most probably nothing bad will happen, but I'd nonetheless avoid that...
Did you try a bus repeater chip such as PCA9515A? (OK, I should re-read the complete thread since answer is probably there...)

Re: Custom I2C sensor problem

Posted: 27 Jan 2011, 16:56
by gloomyandy
That's a pretty drastic solution! As others have said take care with using that port. If you short it out you may well fry the main cpu without that resistor... This question may be rather late, but which sensor port have you been using for all of these tests?

Re: Custom I2C sensor problem

Posted: 27 Jan 2011, 17:18
by aswin0
philoo wrote: Now take care with that port! since regular I2C sensor are 5V powered, you might either fry NXT arm inputs that are only 3.3V tolerant
I read in the datasheet that the IO pins are 5V tolerant. But I will be very carefull indeed.
philoo wrote:Did you try a bus repeater chip such as PCA9515A? (OK, I should re-read the complete thread since answer is probably there...)
I did try a level shifter, as far as I understand this is more ore less the same, but this didn't work. But if there is a bettor solution I would like to know. The repeater chip that you pointed out is not 5V tolerant.
gloomyandy wrote:This question may be rather late, but which sensor port have you been using for all of these tests?
I used port 2 most of the times, but I tried others as well. I removed the resistors from port 3.

BTW, what kind of pullups should I use now the inline resistors are gone?

Re: Custom I2C sensor problem

Posted: 27 Jan 2011, 18:21
by philoo
I did try a level shifter, as far as I understand this is more ore less the same, but this didn't work. But if there is a bettor solution I would like to know. The repeater chip that you pointed out is not 5V tolerant.
Yes it is 5V tolerant. If you power it from 3.3V it will work fine on NXT and will not fry your imu. But if you prefer there is also the PCA9517...
BTW, what kind of pullups should I use now the inline resistors are gone?
Something like 2.2k would probably be fine.

Re: Custom I2C sensor problem

Posted: 27 Jan 2011, 22:38
by mattallen37
Congratulations! I am glad you FINALLY got it to work! BTW, now that you are accessing the pins directly, and that the IMU it's self HAD 4k7 pullups, that is what I would use (maybe even 10K). If the NXT was using something more like the "standard" 100 or 400 kHz speed, then a lower value (like 2k2) would probably be better; however, I will not attempt to argue with Philo, I just think 2k2 is a bit strong.