Connecting a graphical LCD via a I2C using a 16-bit port expander

Today I received some MCP23S17 chips, which are the SPI equivalent of the MCP23017. With some fairly minor circuit changes (the pins are almost identical), and some code changes, the library is now much faster (at the expense of having to run two more wires):

  • Clear screen: 62 ms
  • Draw 96 characters of text: 54 ms
  • Frame a rectangle: 58 ms
  • Fill a rectangle: 622 ms

That is without write-through caching enabled. With it enabled the relevant times dropped to:

  • Frame a rectangle: 48 ms
  • Fill a rectangle: 432 ms

With the exception of big block fills, it now fills the screen very quickly indeed.