Uno to Uno i2c problems


hi there,

i working on automation project involving i2c communication between 2 arduino unos. first has adafruit lcd shield mounted on it, , serves "master". "slave" arduino has adafruit motor shield connected, along 2 stepper motors , electronic pneumatic air solenoid. master arduino used allowing user select type of test run, sending data slave. slave has incrementing counter (since implemented on cycle testing machine) pinged master display. first issue i'm having master seems freeze when connected slave. doesn't happen every time, , can avoided plugging power master first, power logic , motors on slave arduino. however, doing doesn't work, , master not run setup code (displaying company name , setup prompts), , display blank screen. none of buttons, including reset work, forcing me power cycle both arduinos. need have pullup resistor between 2 arduinos prevent problem? reading elsewhere in forums uno's have built in pullup resistor, might not enough? fyi have 3 12v dc wall plugs power sources, 1 master arduino, 1 motors, , 1 slave.

secondly, having trouble shot count displaying correctly. right seems count in powers of 2 (2, 4, 8, 16, 32, 64, etc), display count each cycle completed (1, 2, 3, 4, etc). believe may have scaling of shotcount @ line 228 , 276, not sure. both scripts attached below.

thanks in advance!

the sketches quite ok, thing noticed don't check result codes of wire.endtransmission() (sending part) , wire.requestfrom() (receiving part). should , handle errors.

from above description guess problem in wiring. please post wiring diagram of setup. how long i2c cable? did connect grounds of 2 arduinos?

if i2c signal length more frew cm should install external pull-ups because internal ones weak higher capacitance. distance between arduinos , motors/solenoids?

extremely strange case push on reset button doesn't reset master arduino. never experience such behavior on uno.


Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > Uno to Uno i2c problems


arduino

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino Uno not uploading

Indesign and MathType fonts