Page 1 of 1

I2C Pullups with powered peripheral

Posted: Mon Mar 27, 2017 7:41 am
by Morphology
We all know about adding external pull-up resistors to the i2c bus (SDA / SCL) and, ordinarily, these would be between these lines and the 3v3 rail from the Pi. I have done this many times as, generally, I am then feeding the i2c signals through a bi-directional level shifter before connecting them to a peripheral board running at 5v.

I now have a situation where the peripheral board I am designing has i2c chips that run at 3v3 and, as I want to be able to daisy-chain a number of these on the i2c bus, each of these peripheral boards will have its own on-board 3v3 supply (so that I don't overload the Pi).

My question is: should the pull-up resistors be between the i2c lines and the 3v3 supply FROM THE PI, or should they be between the i2c lines and the 3v3 rail ON THE PERIPHERAL?

Rough sketch attached - should they be in position A or position B or does it make no difference?

Thoughts? Comments?

Morph
i2c pullup.PNG
i2c pullup.PNG (54.94 KiB) Viewed 617 times

Re: I2C Pullups with powered peripheral

Posted: Mon Mar 27, 2017 7:46 am
by joan
The Pi has hard-wired pull-ups to 3V3 on SDA/SCL. You shouldn't add another.

Re: I2C Pullups with powered peripheral

Posted: Mon Mar 27, 2017 8:02 am
by Morphology
True, maybe I'll just leave them off, and it does seem to work fine without them, though I was influenced by the schematics of various external boards such as this Pimoroni bi-directional level shifter, which include 10k pull-ups on the 3v3 side:
level shift.png
level shift.png (6.82 KiB) Viewed 602 times

Re: I2C Pullups with powered peripheral

Posted: Mon Mar 27, 2017 4:29 pm
by FTrevorGowen
Morphology wrote:True, maybe I'll just leave them off, and it does seem to work fine without them, though I was influenced by the schematics of various external boards such as this Pimoroni bi-directional level shifter, which include 10k pull-ups on the 3v3 side...
IIRC, those pull-ups are of an order of magnitude higher in resistance that the Pi's on-board I2C pull-ups (and thus, unless many are connected "in parallel", should have a negligible effect). FWIW, a few level-shifting modules are classed/labelled "I2C safe":
http://www.cpmspectrepi.uk/raspberry_pi ... dules.html
Trev.

Re: I2C Pullups with powered peripheral

Posted: Mon Mar 27, 2017 4:44 pm
by Burngate
Morphology wrote:... this Pimoroni bi-directional level shifter ...
That can be used on any GPIO, not just the I2C ones. Leaving the resistors off would perhaps compromise its versatility, while putting them on doesn't hurt the I2C