[Moved] Controlling 5 MCP23017 I2Cs in Sequence.

Status
Not open for further replies.

DaveKlebt

Newbie level 2
Joined
Nov 28, 2017
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
15
i need some assistance - i need to set up 5 MCP23017 to drive five banks of 16 channel relays. in testing the addressing to pins Ao, A1, and A2, i started with the relay banks.

I placed a ground on A0, A1 and A2 in the first I2C chip. The code uses the wiringpi Setup library. the addresses for the GPAO outputs is:
wiringpi.mcp23017Setup(101, 0x20) # set up the pins and i2c address
wiringpi.mcp23017Setup(117, 0x23) # set up the pins and i2c address

The I2C chip was set with A0 no ground, and A1 and A2 with grounds.

The second relay bank mirrors the action on the first.

When i alter the code to address the address on the range from 117 - 133) nothing happens.

any advice will most welcome.
 

Hi,

A general rule:
Don't leave (unused) inputs floating. This is true for digital inputs as well as analog inputs.

In your case the datasheet especially says: "Hardware address pin. Must be externally biased."
Which means you need to drive them either HIGH or LOW. Leave them floating is not allowed.

Klaus
 

Thanks, I actually figured that out! voltage in gives a 1, ground a O. i have successfully addressed 5 chips. But i appreciate your assistance.

 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…