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

\$\endgroup\$
  • 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\$ – JYelton Mar 4 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\$ – User323693 Mar 4 at 1:25
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.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Yes, I had to use 1.5k resistors between the logic level shifter and the 3x MCP23017 to get it to work. \$\endgroup\$ – Mark Stevens Mar 4 at 0:03
0
\$\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.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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