I tried reading from the INTCAP instead of the GPIO with much better results.
Got more tests to do.
EDIT: Nope, not that, nevermind...
Robert
:)
Printable View
I tried reading from the INTCAP instead of the GPIO with much better results.
Got more tests to do.
EDIT: Nope, not that, nevermind...
Robert
:)
Robert,
As I'm not using the MCP23016 I haven't read the entire datasheet.
But looking at your schematic there is one thing that may cause strange effects:
you have switches to VDD, but no PullDown Resistors.
So when the switches are open the MCP's inputs are floating.
(I would prefer to have the switches connected to GND and have PullUps to VDD)
I
ARGH!
Thanks Ralph! I can't believe I missed that. Pull-up resistors is one of those things that I watch out for in all switches.
But I've been so busy learning new stuff on this circuit that I've totally forgotten what I consider to be a basic thing. I was so sure I had misunderstood something in the MCP23016 datasheet, or wired an I2C device improperly, a pull-up resistor never dawned on me.
The circuit works beautifully now.
Robert
:)