0
\$\begingroup\$

In the image below the circuit sometimes works perfectly, but sometimes the SDA and SCL lines appear to be pulled to a middle voltage value rather than Vcc and GND.

Also, this circuit works when using a digital multimeter to read the voltage values of SDA and SCL near the I2C master (downstream of a logic-level shifter) but stops working when it is removed.

enter image description here

enter image description here

asked Mar 3, 2020 at 23:57
\$\endgroup\$
2
  • 1
    \$\begingroup\$ Consider posting a schematic of the relevant part of the circuit you're working on as well, in case there's something you missed or omitted. \$\endgroup\$ Commented Mar 4, 2020 at 0:05
  • 1
    \$\begingroup\$ What is the part number of the level shifter? 1.5k pull-up is too high it seems. Also evident from th shifted ground in the picture. Where are you probing? Can you also probe at raspberry PI output as well as just after level shifter output. \$\endgroup\$ Commented Mar 4, 2020 at 1:25

2 Answers 2

1
\$\begingroup\$

I think your level shifter isn't connected right.

As a test, can you run the system without the level shifter and pull up to 3.3V at the host instead? This should work fine, logic-level wise, the MCP23017 can see 3.3V signals ok.

If you feel you really need 5V I2C, I've used this device in a production product for HDMI DDC signals which require a 5V pull-up. Later, I moved on to using discrete n-channel FETs with equal success. Comparing to your system, HDMI cabling is up to 10', much longer than what you're doing.

This level shifter has active pull-up to improve risetime. Also worth a look.

answered Mar 4, 2020 at 0:29
\$\endgroup\$
0
\$\begingroup\$

Do you have pull-up resistors on your I2C lines? 4.7k are typical values. My guess would be that there's nothing to pull them up (which I2C requires) as the devices typically only pull the lines down.

SparkFun has a decent article that covers I2C basics and gotchas.

answered Mar 4, 2020 at 0:00
\$\endgroup\$
1
  • \$\begingroup\$ Yes, I had to use 1.5k resistors between the logic level shifter and the 3x MCP23017 to get it to work. \$\endgroup\$ Commented Mar 4, 2020 at 0:03

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.