bulwynkl
Posts: 1
Joined: Wed Feb 24, 2016 4:17 am

GPIO questions I2C and etc.

Wed Feb 24, 2016 4:31 am

Hi Folks,

just started working with RPi and encountered a few issues. Looking for advice/guidance/"this is how one would normally do XYZ
"...

for starters - wiring up multiple I2C devices - how does one actually daisy chain several devices together, physically? Connecting an individual sensor is straight forward with jumpers or even a stacked GPIO extender, but if I want to keep it neat and simple, do I have to hack several wires together into a common bus? I suspect there is an easier way to do thi, that I'm missing.

secondly - I believe you can shift the pin assignments on the GPIO, e.g. Device Tree - I understand this in theory but in practice I have NFI - tutorial?
On that topic, is there a limit to the GPIO pins you can shift around? can you for example move (or duplicate) the 3.3V pin, or the ground pins, for example. Or does the DT only allow you to shift data pins?

This all came about when I tried to use a PiFaceCAD and a BMP180 - even thought the PiFace CAD doesn't use the I2C pinouts, it consumes the top 26 pins and doesn't have an extended pinset - so presumably I need to do some ugly soldering...

Abandoning the PiFace for this project - for unrelated reasons - so now looking for an elegant solution to combine a I2C sensor and I2C LED backpack... hence the need to connect multiple I2C devices to the same 4 pinouts (3.3V, ground, SCL and SDA)

fsr
Posts: 88
Joined: Wed Jan 13, 2016 2:29 am

Re: GPIO questions I2C and etc.

Wed Feb 24, 2016 8:24 am

bulwynkl wrote:how does one actually daisy chain several devices together, physically?
i2c uses 2 wires clock & data. it can support 127 devices on one bus.
connect wires up like this
clock line from pi -> clock on first device -> clock on second device
data line from pi -> data on first device -> data on second device
bulwynkl wrote:I believe you can shift the pin assignments on the GPIO
Not in this case.
the I2C pins are in specific places and you need to use those specific pins
(a software / bit banged i2c can use any GPIO pin but the hardware one is superior)
bulwynkl wrote:is there a limit to the GPIO pins you can shift around? can you for example move (or duplicate) the 3.3V
Yes there are limits, No you certainly cannot rearrange non gpio pins like 3.3v and grounds
the rearrangment is very limited. to see /boot/overlays/README on your PI for gory details

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