Quote Originally Posted by Darrel Taylor View Post
Since you are using an 18F4550, it means you are using MPASM as the assembler.
So, DEFINE i2c_hold 1 needs to be Uppercase.

Not sure what you mean here. The INTCAP? registers are read-only.

Also not sure what you are trying to do with the port.
You write all 1's to the output latch OLAT1, then set all but 1 pin to input IODIR1, then write to GP1 which actually writes to OLAT1 again. Doesn't make sense.

What is it you're trying to do, and what's not working.
Thank you Darrel!

I changed it, so now I have DEFINE I2C_HOLD 1...
but that did not change anything.

With INTCAP I just wanted to say that it is the only register that is read-only, besides it was kind of irrelevant from me to mention that in the first place

The final goal is to use the device as an input extender, that is only inputs. However, one should also be able to read and write all registers, except one. Nothing seems to work, as earlier told, I can't tell if it is the write or read that fails. I have tried all kind of values and also changing the sequence of those three initializing lines but without any sign of life. Well, of course maybe some kind of quiet life when not the error label is activated.

What values would you suggest to use in the initialization section and what sequence would you use for those three init lines?