ff-mcp23s17: Successful Output Test
I was able to set the GPIOs to output mode and to set the GPIOA pins to pattern 10101010. Here is me testing it with a voltmeter:
Arduino Nano driving an MCP23S17 GPIO Expander module
It turns out that I was sending SPI signals correctly, but that I had make a mistake in the register data I was sending. The IODIRA register, which sets the pins to input or output, requires a 1 for input and a 0 for output. I had assumed it was 1 for output.
MCP23S17 data sheet snippet: IODIR
I have found that if a MC periphal is not doing what is expected, the problem generally comes down to one of five issues:
- You have issues with your power supply or voltages.
- You have wired the pins incorrectly.
- You have your communication settings wrong (SPI sampling settings, for example).
- You do not properly understand how your control, addressing, or data frames are supposed to be sent or received.
- You are not setting a register bit correctly.
That's great that you got it figured out! By the way, the link to the data sheet just gives me a permanent failure when I click it.
Just tested again this morning. It works now.