I'm trying to use the MCP23017 I2C port extender which has 3 addressing pins to be externally biased to set the I2C device address.

How should I connect the 3 addressing pins to select the I2C address that I want? I was not able to identify a table mapping the biasing to the I2C address in its datasheet.

Also, should I be biasing by connecting some address pins to GND, some to 5V of my Raspberry? Diagram below show show I am currently wiring up three MCP23017 to a single Raspberry 3. Does the wiring look ok?

[Link to clearer image]

enter image description here

  • \$\begingroup\$ table 1-1 and figure 3-6 in the datasheet \$\endgroup\$ – jsotola Jan 18 '18 at 17:21
  • \$\begingroup\$ you can iterate I2C devices, so just try a combo and scan. \$\endgroup\$ – dandavis Jan 18 '18 at 20:41

Figure 3.4 (Page 15 of the datasheet shows the device addressing), and yes A0,1,2 are digital inputs, 0 or 5V depending should be fine.

Read the device errata I recall being being some shenanigans, but that may have been only the SPI variant.

  • \$\begingroup\$ Thank you! Am I right to say that in the schematic in the question, the bottom most MCP23017 has a slave address of 0x20, and the top most MCP23017 has a slave address of 0x22? \$\endgroup\$ – Nyxynyx Jan 18 '18 at 18:52
  • \$\begingroup\$ In 7 bit format, yes. \$\endgroup\$ – Dan Mills Jan 18 '18 at 20:01

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.