Sharing i2c pins

by Rahatmaini on Thu Jan 17, 2013 8:22 pm

Usually whenever I read descriptions of i2c devices on this website, they always say that it uses two i2c pins WHICH CAN BE SHARED with other devices. I am not very familiar with i2c but I know it has something to do with assigning addresses to devices.

Can anyone please explain how i2c pins can be shared?

Thank you! I appreciate your time taken to read this. :D
Rahatmaini
 
Posts: 165
Joined: Wed Aug 29, 2012 4:15 pm

Re: Sharing i2c pins

by adafruit_support_bill on Fri Jan 18, 2013 5:25 am

Essentially, all the devices on the bus listen to the "Master" and only respond when a command is addressed to them. For a more detailed explanation of the bus protocol and how this works electrically, i2c.org has some excellent tutorials on the subject: http://www.i2c-bus.org/i2c-primer/
User avatar
adafruit_support_bill
 
Posts: 25524
Joined: Sat Feb 07, 2009 9:11 am

Re: Sharing i2c pins

by reg3har on Thu Jan 24, 2013 7:59 pm

This is the best topic i could find in which to ask my question.... I am going to be sharing I2C pins between 4 slave devices and 1 master. All , except the adafruit 16 servo driver, say to add the two 10K pull-up resistors on the lines. The adafruit webpages do not have, nor mention, these resistors. I want to verify that having the pull-up resistors will not adversely affect the servo driver. So will they? Thanks
reg3har
 
Posts: 5
Joined: Thu Jan 17, 2013 10:09 am

Re: Sharing i2c pins

by adafruit_support_bill on Thu Jan 24, 2013 8:10 pm

Generally, you need 1 set of pullup resistors on the bus. The Adafruit servo driver includes pullups:
https://github.com/adafruit/Adafruit-16 ... Driver-PCB
User avatar
adafruit_support_bill
 
Posts: 25524
Joined: Sat Feb 07, 2009 9:11 am

Re: Sharing i2c pins

by ennbr on Fri Jan 25, 2013 4:41 pm

This brings up a question I've had why do all of the Adafruit I2C boards have the pull-ups enabled they should be there but optional. My current project has more than 25 I2C devices 15 Arduinos and many additional boards from Adafruit. I'm going to be forced to remove the pull-ups very time consuming from all of the extra boards. The only pull-ups necessary are to terminate the buss. If I were to leave the pull-ups on the other 10-15 boards I risk damage to the I2C ports on the Arduino boards.

Just my two cents.
ennbr
 
Posts: 26
Joined: Sun Feb 12, 2012 11:17 am

Re: Sharing i2c pins

by adafruit_support_bill on Sat Jan 26, 2013 6:02 am

Multiple pullups alone is not going to cause damage. Although too many pullups may start to affect the performance of the bus.

The danger of damage comes when you start mixing 5v pullups with 3.3v devices. 3.3v pullups with 5v devices is not a problem.
User avatar
adafruit_support_bill
 
Posts: 25524
Joined: Sat Feb 07, 2009 9:11 am

Re: Sharing i2c pins

by ennbr on Sat Jan 26, 2013 7:26 am

My question still stands in future boards and revisions can the i2c pull-ups be optional solder pads to enable
ennbr
 
Posts: 26
Joined: Sun Feb 12, 2012 11:17 am

Re: Sharing i2c pins

by adafruit_support_rick on Sat Jan 26, 2013 10:20 am

ennbr wrote:My question still stands in future boards and revisions can the i2c pull-ups be optional solder pads to enable
I'll pass along your request. By way of explanation of our design philosophy, however, the majority of our customers use only a few I2C devices at a time, and we prefer to keep configuration options to a minimum to avoid confusion.
User avatar
adafruit_support_rick
 
Posts: 8575
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Sharing i2c pins

by reg3har on Sat Jan 26, 2013 10:31 am

adafruit_support wrote:Generally, you need 1 set of pullup resistors on the bus. The Adafruit servo driver includes pullups:
https://github.com/adafruit/Adafruit-16 ... Driver-PCB

That is excellent. Thank you very much for your timely answers and all the great things adafruit industries does for the community!
reg3har
 
Posts: 5
Joined: Thu Jan 17, 2013 10:09 am

Re: Sharing i2c pins

by ennbr on Sat Jan 26, 2013 11:31 am

Thanks driveblock my design is pushing i2c to an extreme
ennbr
 
Posts: 26
Joined: Sun Feb 12, 2012 11:17 am

Re: Sharing i2c pins

by adafruit on Sat Jan 26, 2013 12:12 pm

thanks for the suggestion
if you are putting 25 i2c devices such as the servo board together, you may want to just remove the 10k's on a few of them. thats easy to do with either diagonal cutters (crush the resistors) or soldering iron (heat both sides and remove)
to keep it simple, all of our i2c designs have built in pullups so you can use them with an arduino without any other components.
User avatar
adafruit
 
Posts: 11508
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: Sharing i2c pins

by adafruit_support_rick on Sat Jan 26, 2013 12:41 pm

ennbr wrote:Thanks driveblock my design is pushing i2c to an extreme

For me, that's where the fun is - seeing just how much you can really squeeze out of this stuff. :D
User avatar
adafruit_support_rick
 
Posts: 8575
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY