Go Down

Topic: problems Using TWI I2C with UNO and Motor Shield (Read 2359 times) previous topic - next topic

Xnloder

I have two UNO boards with motor sheilds and want to use I2C (TWI) to comm b/t the UNO boards.  The comm works intermittently.  I take off the motor shield and connect the I2C wires directly to the UNO board and the comm works great.  I've ordered NO-OX-ID conductive paste to put on the male pins of the motor sheild and onto the male pins I put into the motor shield, and expect this will fix the problem.  Just wanted to share an easy fix to an annoying problem!

Xnloder

RuggedCircuits

Are you sure it's not electrical noise? Did you add pullup resistors to the I2C wires or are you relying on the built-in ones (I don't think they're low enough in value so I always add external 1.5k pullups)?

Is the comm intermmittent even when the motor shield is completely off? That would tell you whether or not it's an electrical noise issue.

--
Beat707: MIDI drum machine / sequencer / groove-box for Arduino

Xnloder

Yeah, I'm sure:  the problem follows the motor shield.  I ran w/o the shield for 3 hours and never missed a byte, which, with an intermittent is not definitive, but strongly indicative. 

The system has 2.2K pullups:  the 40K internal pullups deform the square wave into a sawtooth and make reliability unlikely (http://www.dsscircuits.com/articles/effects-of-varying-i2c-pull-up-resistors.html).

Hey, its a cheap fix once the problem is identified!  And the profanity I was aiming at the system wasn't helping at all (though the cat thought it was amusing).

Xnloder

The conductive grease (no-ox-id) did not fix the problem. 

Remove motor shield, I2C works.  Add motor shield, I2C doesn't work.  There is nothing to the motor shield connection except a square peg and a square hole...not rocket science.  Yet a solution eludes me.

Anyone out there have an idea on this?

RuggedCircuits

Which motor shield is this?

By "running with the motor shield off" I really meant running with the motor shield mechanically attached but not doing anything: no motor connection, no power to the shield, etc.

My thinking is that it's electrical noise. If you can eliminate all other variables than actual current going through the motor shield and to the motors then that will support my theory.

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons

Xnloder

Rugged Circuits:

In 'running w/ shield off', I did as you described, and had no electrical connections to the shield but TWI and VCC->pullupResistors.

I'm inclined to agree...it is a noise issue:  on power-up from cold, TWI works for about a minute, then decays rapidly to nothing.

The bug follows a particular instance of Adafruit's motor shield (http://www.adafruit.com/index.php?main_page=product_info&cPath=17_21&products_id=81).  I have four UNO boards and four motor shields, and this problem follows a particular board. 

I have had occasional TWI data fallout from other boards, which inclines me to the belief the problem is systemic to the shield but particularly prevalent to this single shield.  The solution seems to be to implement a CRC to verify data and resend on faults.   And trash the faulty board. 

If you are curious, in debugging this I reflowed the faulty board's solder joints entirely under the thesis a cold||faulty joint might be causing it, but the connections between Analog 4 and 5 (TWI) through the motor shield are minimal...there are just no active components to mess things up, no use of VCC or ground (except through the pullup resistors), nothing but male/female plugs.  Gremlins.

Thank you for your insights.

Xnloder

Go Up