Hi,
I am trying to get an Mcp23s17 interfaced with my NP2 to eventually drive an LCD screen.
I am not having much success getting the Mcp23s17 to work. The first simple scenario I was thinking was to just light up a simple LED using one of the GPIOs on the Mcp.
I have updated to the latest firmware in hopes that there were some issues there.
I am attaching a pic of how it's wired, in case something is wrong there (but I hope not).
I have modified the MFToolbox code for Mcp23017 to basicly use SPI instead, and I have tried manually just sending the commands to the device via SPI write. But so far no luck what so ever.
When using SPI directly:
spiConfig = new SPI.Configuration(Pins.GPIO_PIN_D10, false, 0, 0, false, true, 1000, SPI_Devices.SPI1); Microsoft.SPOT.Hardware.SPI spi = new SPI(spiConfig); spi.Write(new byte[] { 0x40 }); // Adress spi.Write(new byte[] { 0x00, 0x00 }); // Set bank A to output spi.Write(new byte[] { 0x01, 0x00 }); // Set bank B to output spi.Write(new byte[] { 0x12, 0xff }); // Set bank A outputs to high spi.Write(new byte[] { 0x13, 0xff }); // Set bank B outputs to high spi.Dispose();
Or when using the quickly modified mcp23017 code:
spiConfig = new SPI.Configuration(Pins.GPIO_PIN_D10, false, 0, 0, false, true, 1000, SPI_Devices.SPI1); var mux = new Toolbox.NETMF.Hardware.Mcp23s17(spiConfig); for (int i = 0; i < 16; i++) { mux.Pins[i].Write(true); }
Any help or suggestion on the matter would be appreciated