Quote Originally Posted by Demon View Post
MCP23017 I/O Expanders can run up to 1.7 MHz in I2C mode.
MCP23S17 I/O Expanders can run up to 10 MHz in SPI mode.
That's the wire speed... you'll never get the code to run anywhere near that fast except for a single byte transaction.
You won't get I2C to run that fast without active pullups, and getting the PIC to do 10MHz SPI depends on your system clock.