The smallest resister I have used for I2C is 4.7K, also you need to initialize the MCP23017 correctly.


Also you have set your port direction to input
IODIRA con $FF ' port A output
IODIRB con $FF ' port B output

to make the port output you need to change the $FF to $00, just like setting a port direction in a PIC.

Good luck

Dave