Custom I2C sensor problem

Discussion specific to the intelligent brick, sensors, motors, and more.
aswin0
Posts: 201
Joined: 29 Sep 2010, 06:58

Re: Custom I2C sensor problem

Post 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!
My blog: nxttime.wordpress.com
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: Custom I2C sensor problem

Post 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
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
philoo
Posts: 76
Joined: 29 Sep 2010, 09:04
Location: Paris, France
Contact:

Re: Custom I2C sensor problem

Post 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...)
Philo
philoo
Posts: 76
Joined: 29 Sep 2010, 09:04
Location: Paris, France
Contact:

Re: Custom I2C sensor problem

Post 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...)
Philo
gloomyandy
Posts: 323
Joined: 29 Sep 2010, 05:03

Re: Custom I2C sensor problem

Post 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?
aswin0
Posts: 201
Joined: 29 Sep 2010, 06:58

Re: Custom I2C sensor problem

Post 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?
My blog: nxttime.wordpress.com
philoo
Posts: 76
Joined: 29 Sep 2010, 09:04
Location: Paris, France
Contact:

Re: Custom I2C sensor problem

Post 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.
Philo
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Custom I2C sensor problem

Post 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.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 15 guests