0

Im having a problem with my current project.

I am using a 128x32 oled for stats and an RTC. I also have a logic level shifter with a plug attached for optinal extention(like lcd, etc) running on 5V.

But when i have no device attached to that same shifter the I2C test gives me all Ids(as if all ids where used) and in so chrashes my python script for the oled.

I cant just turn off the shifter because it also shifts SPI and so sometimes the I2C is still unused.

Is there away to maybe pulldown the I2C pins on the 5V end to stop the problem?

1
  • 1
    Can you add a circuit schematic to your question. I do not understand what you have connected.
    – joan
    Feb 22 at 22:07

3 Answers 3

0

"maybe pulldown the I2C pins on the 5V end" definitely NOT!

I²C uses pullup.

If i2cdetect shows all it means SDA is pulled low.

If you are using level shifter for I²C this ASSUMES pullup to 5V (although depends on design of level shifter). If there is no pullup you don't need level shifter because I²C is open drain.

0

Normally when I use 5V devices on I2C I do not use a level shifter. If you read the specification I2C is an open drain/collector pin and is only driven low, for a high it depends on the pull up resistors. I use something in the range of 3K depending on the bus load to the +3V3. Also you must be careful that none of the I2C devices have pull up resistors to +5V. You can connect everything up except the connection to the Pi then power it up and measure the I2C wires that will connect to the Pi and be sure they read 3V3 or a little bit less. If not you either have a pull up on it or a failed device. At5 that point if the software is valid it should work properly.

0

So I just removed the shifter as it was reading LOW/HIGH(just all over the place) with no connection.

Also removed the Pullup-resistors on the LCD itself because it was reading 5V.

Fixed the i2cdetect reading nonsense.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.