Pages: [1]   Go Down
Author Topic: lowering I2C speed with arduino UNO  (Read 1076 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi!
i am not an arduino guy, and i have a poor electronic background. i use arduino only for fun in the spare. and this is my first project with multiple arduino communications. so sorry me if i write stupid things (and sorry for my bad english, too).

i have some boards that are communicating with i2c. but for reduce the noise signal i have set the velocity of the communication slower (following this: http://arduino.cc/forum/index.php/topic,12518.0.html ). the noise is caused by the long wire (more then 2 meters).

Yeah ok i know i should use some bus extender and this is a dirty hack, but for now it seems to works. I have tested it with the new Arduino Leonardo and it works right. One master (the master is an arduino MEGA), 2 leonardo childs, no problem. But it seems to have problem with older arduino (Arduino UNO).

I have tested it with a simple sketch, with one master and one slave: the master request one byte of status (0 or 1, ready or busy) each 500 milliseconds and if master recive something from serial, it send a number from 0 to 9999 to the slave (and the slave stay busy for that number of milliseconds).

Same code, same wiring (3 wires from master to slave: gnd, slc, sda), with a leonardo as slave, no problems, with UNO as slave, after the first request the communication crashes (and cause also the master to crash because there is no timeout in standard wiring library - untill i unplug the slave).

Some advice or any consideration of any kind?
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Some examples on this page of lowering the speed (you can get it quite low):

http://www.gammon.com.au/i2c

What size pull-up resistors do you have on SDA/SCL?
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i doesn't have pullup resistor.. i thought the internal one was ok..

EDIT: great page anyway, thanks!
« Last Edit: November 18, 2012, 06:22:58 am by mantissa00 » Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I strongly suggest the pull-up resistors. Then see how it goes.
Logged

Pages: [1]   Go Up
Jump to: