Author Topic: What happens when there is an I2C address conflict between GPIO expanders  (Read 1955 times)

0 Members and 1 Guest are viewing this topic.

Offline SlowBroTopic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: us
What happens when there is an I2C conflict between GPIO expanders such as the MCP23017 where both chips are set to the same address, and their pins are set to output? Do they not work at all, do you get magic smoke, or do identical pins on both work identically, or is it device-specific e.g. this model might work identically but another might cause magic smoke...
« Last Edit: November 07, 2017, 08:23:05 pm by SlowBro »
 

Offline rt

  • Regular Contributor
  • *
  • Posts: 68
  • Country: ie
Re: What happens when there is an I2C conflict between GPIO expanders
« Reply #1 on: November 07, 2017, 01:28:20 pm »
Your question is a bit unclear.

1) Do you mean an I2C address conflict where for example two MCP23017 expanders are set up with the same I2C address?

Solution: change the pull-up/down resistors on the address pins (A0-2) to change the address of one of the chips.

2) Or that the output pins of two MCP23017 are connected to each other with both in output mode?

The key here is that on the MCP23017 any output pin can only source or sink 25mA (see data sheet).  Driving one pin high and the other low may well drive more current than that and blow one/both pins.

Without a circuit diagram or a clearer application it's hard to say more.

rt
Until proven otherwise, all TED talk presenters should be considered as charismatic charlatans.
 

Offline SlowBroTopic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: us
Re: What happens when there is an I2C conflict between GPIO expanders
« Reply #2 on: November 07, 2017, 08:22:14 pm »
Your question is a bit unclear.

1) Do you mean an I2C address conflict where for example two MCP23017 expanders are set up with the same I2C address?

Solution: change the pull-up/down resistors on the address pins (A0-2) to change the address of one of the chips.

Yes, an address conflict. If both are set to use the same address what would happen?

(Edited the OP to clarify.)
 

Offline rt

  • Regular Contributor
  • *
  • Posts: 68
  • Country: ie
Re: What happens when there is an I2C conflict between GPIO expanders
« Reply #3 on: November 07, 2017, 09:05:04 pm »
Your question is a bit unclear.

1) Do you mean an I2C address conflict where for example two MCP23017 expanders are set up with the same I2C address?

Solution: change the pull-up/down resistors on the address pins (A0-2) to change the address of one of the chips.

Yes, an address conflict. If both are set to use the same address what would happen?

(Edited the OP to clarify.)

You'll probably get garbage on the I2C bus because both MCP23017 chips will reply slightly out of sync (even if data is identical) and definitely out of sync if there is different data coming back to the microcontroller. 

I don't believe that I2C function is ever guaranteed for two devices with the same I2C address on the same bus.

Can you outline why you are considering this approach?  Extra current supply to a load?  Surely just use a line driver as a high current buffer?

rt
Until proven otherwise, all TED talk presenters should be considered as charismatic charlatans.
 

Offline SlowBroTopic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: us
Re: What happens when there is an I2C address conflict between GPIO expanders
« Reply #4 on: November 08, 2017, 06:27:16 pm »
It's for the accidental situation where a user wouldn't pre-set the address jumpers differently than their existing GPIO expanders.

What data would be coming back from a GPIO expander if it's output-only?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf