MCP23017 question - help please
Cheetah
Posts: 26
I'm trying to get the BS2pe to work with the MCP23017 but so far I have been unable
to get it to respond.
I have LED's connected to GPB2 and GPA1. All I'm trying to do is turn on these LED's.
The MCP23017 has the device address pins (A0, A1 and A2) all grounded to 0.
Does anybody see anything wrong the code below?
Thank you
to get it to respond.
I have LED's connected to GPB2 and GPA1. All I'm trying to do is turn on these LED's.
The MCP23017 has the device address pins (A0, A1 and A2) all grounded to 0.
Does anybody see anything wrong the code below?
SDA PIN 8 SCL PIN 9 DevType CON %0100 << 4 ' Device type DevAddr CON %000 << 1 ' address = %000 -> %111 Wr23017 CON DevType | DevAddr | 0 ' write to MCP23017 Rd23017 CON DevType | DevAddr | 1 ' read from MCP23017 IODIRA CON 0 IODIRB CON 16 OLATA CON 10 OLATB CON 26 I2COUT SDA, Wr23017, IODIRA, [noparse][[/noparse]%00000000] ' GP0 pins are outputs I2COUT SDA, Wr23017, IODIRB, [noparse][[/noparse]%00000000] I2COUT SDA, Wr23017, OLATA, [noparse][[/noparse]%11111111] I2COUT SDA, Wr23017, OLATB, [noparse][[/noparse]%11111111]
Thank you
Comments
Do you have the 4.7K pull-up resistors on the SDA/SCL lines?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
and see how it goes. I'm more of a software guy so I didn't think of that.
I put in the 2nd one we bought and everything worked fine.
Thanks anyway.