raspberrypivictim
Posts: 30
Joined: Sun Jan 22, 2012 10:35 pm

connect two Raspberry Pi using i2c

Mon Apr 15, 2013 1:33 pm

Hi everyone,

I have been playing a little with de rpi gpio. Mostly buttons, leds and resistors. And as I am a happy owner of two rpi, I thought about connecting both using i2c. The idea is to button push in one, talk about this event to the other rpi via i2c, and light a led in the other one.

I have been googling a lot, but I am getting really confused as I now have some doubts.

The i2d address in the rpi is fixed? I think so. So it would not be possible to connect two "i2c artifacts" in the same i2c bus with the same address. Am I correct? is there a way to change de i2c rpi address?

I also have read that in rev2 ones, there are two i2c buses, I suppose with different i2c address, but I own rev1 ones.

Thank you very much in advance.

User avatar
joan
Posts: 15284
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: connect two Raspberry Pi using i2c

Mon Apr 15, 2013 1:37 pm

You could use the serial link instead. Or just connect them with Ethernet, wired or wirelessly.

I think the Pi always acts as an I2C master which may prevent it working as you want (I'm a naive user of I2C so don't know for sure).

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: connect two Raspberry Pi using i2c

Mon Apr 15, 2013 4:09 pm

Dont use two Pi connection with I2C it can only act as Master not slave so unable to respond to another Pi asking for or sending data.

As joan said use UART or network much easier hardware and software wise.
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

raspberrypivictim
Posts: 30
Joined: Sun Jan 22, 2012 10:35 pm

Re: connect two Raspberry Pi using i2c

Mon Apr 15, 2013 6:47 pm

Thank you all.

It was just an experiment, but as you say, it cannot be done.

Now I will connect them to both Arduinos.

Return to “Interfacing (DSI, CSI, I2C, etc.)”