0

Two MCP23017 over I2C
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Two MCP23017 over I2C

by corvanessen on Tue Feb 12, 2019 3:34 pm

Hi,

I am trying to talk to two MCP23017 's over I2C with a ESP8266. They should be able to change their address with three pins assigned for it, but I don't understand how to do this.

Do I connect some to ground or +3V??

I am using CirucuitPython and bitbangio.
The scan works, but just shows one address (0x20)

Any help is welcome!

corvanessen
 
Posts: 27
Joined: Sat Dec 13, 2014 11:50 am

Re: Two MCP23017 over I2C

by adafruit_support_carter on Tue Feb 12, 2019 3:40 pm

Should be able to use the A0, A1, and A2 pins to set the lower 3 bits of the I2C address.
https://cdn-shop.adafruit.com/datasheets/mcp23017.pdf
mcp23017_i2c_addr.jpg
mcp23017_i2c_addr.jpg (17.35 KiB) Viewed 68 times

adafruit_support_carter
 
Posts: 9835
Joined: Tue Nov 29, 2016 2:45 pm

Re: Two MCP23017 over I2C

by corvanessen on Tue Feb 12, 2019 4:09 pm

Hi!
Thanks for the super fast response!
the description says 'The address pins should be externally biased'

So I am still stuck with the same question. Do I connect to GND or +V?
and if we connect i.e. A0 to something, does that affect the channel called A0?

corvanessen
 
Posts: 27
Joined: Sat Dec 13, 2014 11:50 am

Re: Two MCP23017 over I2C

by adafruit_support_carter on Tue Feb 12, 2019 4:14 pm

You need to connect each one to either GND or V+. Connecting to GND sets the bit to 0. Connecting to V+ sets the bit to 1. So, for example, connect all 3 to GND, you get A0=A1=A2=0, address = 0b0100000 = 0x20.

adafruit_support_carter
 
Posts: 9835
Joined: Tue Nov 29, 2016 2:45 pm

Re: Two MCP23017 over I2C

by corvanessen on Tue Feb 12, 2019 4:30 pm

aaah thank you!
That makes so much more sense to me.

corvanessen
 
Posts: 27
Joined: Sat Dec 13, 2014 11:50 am

Please be positive and constructive with your questions and comments.