1

Hello im doing and experiment trying to Expand my raspberry to use 7 I2C devices (MCP23017 E/SP) its my first time using more than 1 MCP

Im using SparkFun Solderable Breadboard to conect Pi 5v / GD to a rail

and SCL and SDA to the other rail

Adress 0x20 is my Adafruit LCD Backpack (I2C)

In my First Breadboard

Adress 0x21 to 0x24 are MCP23017 E/SP

In my Second Breadboard Daisy Chained to the first one

Adress 0x25 to 0x26 are MCP23017 E/SP

When im using just one Bread Board my Adresses are Correct

0x20 for the LCD

0x21 to 0x24 for the MCP's

But when i connect the second One

This happens.

https://pastebin.com/r8DYb1Un

Every second each Bus goes Off and my LCD 0x20 isnt showing.

What is causing this? did my i2c bus blew up?

When i disconnect the second breadboard everything goes normal withouth intermittence. it just happens when i connect the second one with the adresses 0x25 and 0x26

  • Sounds like a wiring problem. Could you please provide one or more photos which allow us to clearly see the wiring. – joan Aug 27 at 20:49
  • @Arukaito, There are 101 reasons for MCP23017 addressing problems. I did once connected 8 such devices successfully. You might like to read my story below: raspberrypi.org/forums/…. – tlfong01 Aug 28 at 2:47
  • Reason 1 - Equivalent pull up too strong. If you are using a breakout/module which has an on board pull up of 4k7 or 10k, you need to remove/desolder it for all modules except one, to make sure the equivalent/resultant is not stronger than about 1k5. Rpi3b+ I2C SDL/SDA already have built in pull up of 1k7, which is already very strong. – tlfong01 Aug 28 at 8:27
  • @tlfong01 thank you for your answer but im not using any breakout/modules, im reading the post now thanks :) – Arukaito Aug 29 at 13:36
  • @Arukaito, BTW, my MCP23017 story is too long to read, perhaps I can give one more probable reason, that is about the wiring. I think Rpi3B+ is like other I2C masters, can only drive a maximum at 400p capacitance (See TI and NXP app notes for details). When I was experimenting, I added MCP23027 modules one by one on the bus. Usually one to three modules has no problems. But when 4 or 5 are on the bus, then things are not stable. I also found that some modules cause less trouble, perhaps they have less capacitance. / to continue, ... – tlfong01 Aug 29 at 14:00
1

First off, all signal pins on the Pi are 3.3V. If you are powering your circuit from the 5V rail, you are going to damage your Pi if you haven't already partially fried it. What value pull-ups are you using? (You are using pullups, right?) Make sure all your wires are as short as possible, and really make sure you are actively driving the address pins, either by pulling them to ground or with a 10K or so pullup to 3V3. Also, don't leave the RESET pin floating, it could also be the cause of your random failures. Finally, try to run the bus at 100kHz, you are less likely to have problems with parasitic capacitances are that low speed.

  • Hello JayEye i will change the rail to 3V and make my cables shorter. but i just cant wrap my head around where to put the Pull ups on the MCP23017? in the SDA SCL rail? Also my RESET is on the Voltage Rail is it floating? Just to mention my knowledge of this topic its pretty low, im doing this for academic purpose – Arukaito Aug 29 at 13:31
  • The I2C bus, being a multidrop bus, is active-pull-down. That is, if any device on the bus wants to send a zero bit, so to speak, it pulls the bus to ground. If it wants to send a 1 bit, it just leaves it alone and it stays high.To keep it high, you need pull-up resistors. Connect a pullup resistor from anywhere on the SDA line to +3V3 and another from anywhere on the SCL line to +3V3. I use anything from 1K5 to 10K for pullups (but same value on both) depending on things like devices on the line, length of wires, etc. Just use whatever you have available. – JayEye Aug 31 at 1:26
  • While we are at it... you are using bypass capacitors for your ICs, right? Just Google the term, but briefly, put a 100n ceramic cap between +V and GND for all ICs, as close as you can get them to the supply pins. When breadboarding, I use the holes right above the corresponding pins, and straddle the IC with the capacitor. Again, value is not terribly important, anything from 47n to 470n should do, just make sure it's ceramic. Welcome to the wonderful world of hardware :) – JayEye Aug 31 at 1:29

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.