Dave, here's my complete code using a 16F877 and MCP23016:

ADCON1 = 7 ' A/D off, all digital
ASM
@ DEVICE PIC16F877, HS_OSC, WDT_OFF, PWRT_ON, BOD_ON, LVP_OFF, CPD_OFF, WRT_OFF, DEBUG_OFF, PROTECT_OFF
ENDASM
define OSC 20
DEFINE I2C_SLOW 1 ' Access I2C device above 8MHz
DEFINE I2C_HOLD 1 ' Permit I2C device to hold clock line low
I2CSCL VAR PortC.3
I2CSDA VAR PortC.4
I2CCTRL con %01000000
I2CLOCB VAR BYTE
I2CWORD VAR WORD
I2CLOCB = $06 ' Set location to IODIR register
I2CWORD = %0000000000000000
i2cWRITE I2CSDA,I2CSCL,I2CCTRL,I2CLOCB,[I2CWORD]
PAUSE 12
I2CLOCB = $00 ' Set location to GPIO register
I2CWORD = %1111111111111111
i2cWRITE I2CSDA,I2CSCL,I2CCTRL,I2CLOCB,[I2CWORD]
end

It doesn't work, and it is using a constant.

I don't understand why either, I had this circuit working a few weeks ago. I'm sure I have something screwed in the code, but I don't see what it can be.

Robert