Ok, I'm trying to read from the 2nd MCP23016 and it's not working smoothly. I display the word on an LCD, and bits seem to flicker sometimes. When I press a button, the corresponding bit turns on, but there are some 'free games' here and there.

Taken from page 15 of MCP23016 datasheet:

To read an MCP23016 register, the Master needs to follow the requirements shown in Figure 1-6. First, the
device is selected by sending the slave address and
setting the R/W bit to logic ‘0’. The command byte is
sent after the address and determines which register
will be read. A restart condition is generated and the
device address is sent again with the R/W bit set to
logic ‘1’. The data register defined by the command
byte will be sent first, followed by the other register in
the register pair.


This is what I am doing, a simple loop:

CYCLE:
' Set R/W bit to 0.
I2CCTRL = %01000000
I2CLOCB = $00
I2CWORD = %0000000000000000
I2CREAD I2CSDA,I2CSCL,I2CCTRL,I2CLOCB,[I2CWORD]
' Set R/W bit to 1.
I2CCTRL = %01000001
I2CREAD I2CSDA,I2CSCL,I2CCTRL,I2CLOCB,[I2CWORD]
LCDOUT $FE,$94,BIN16 I2CWORD
GOTO CYCLE

I've removed the MCT6 and use a separate SDA line pulled up with 4.7K for each I2C device.

Did I misunderstand the instructions?

Robert