I am working with a TCA9535 IO Expander part connected to an 80C51 (Atmel AT89C51AC3) uC.
All of port 0 and pins 3 & 4 of port 1 are inputs (a rotary switch, 4 DIP switches and 2 push buttons).
I believe that I have configured port 1 with pins 0, 1, & 2 as outputs as I am able to drive those lines as desired.
Port 1 pins 5, 6, & 7 are unused and have been pulled to ground.
I can see that the inputs are changing at the pins on the part when I modify the switches/buttons. However, when I try to read anything I am getting all 1's.
I also get all 1's reading the polarity inversion registers (which I have not modified, so expect them to be 0's by default) and the config register for port 1 (which I have modified to 0xF8 or even 0x18).
Although I am pretty confident in my I2C implementation on the uC, it is certainly possible I got something wrong. Watching the SCL/SDA lines with a logic analyzer everything looks good/makes sense.
We are running the everything at 5v and have 4.7k-ohm resistors pulling up SCL and SDA. Thinking the TCA9535 part could not pull the data line low, we put a 47k-ohm resistor on the data line but saw no difference. If that is the problem, it is probable that the part can not hold the clock low to stretch if needed, but we have not made that change.
Any thoughts on what I might be doing incorrectly or further experimentation would be greatly appreciated.
Thanks!
.Tim