mcp23s17 16-bit I/O Port Expander not working ?

Hello everyone, if I am asking help here that’s because I am very desperate and can’t figure out what is not working with my small contraption:

I am trying to work with the mcp23s17 chip. I tried with many libraries, 2 Arduino boards and 2 chip formats, but unfortunately, it does not work.

I am mainly following this guide to work with this chip : Arduino Playground - MCP23S17 Class for Arduino

And the library used here is : GitHub - n0mjs710/MCP23S17: Arduino Driver for Microchip MCP23S17

The portable library + my main code is in attachments if you want to try it yourself.

Here is the setup with an Arduino Nano + mcp23s17 (DIP 28Pins):

And with an Arduino UNO + mcp23s17 (SOP4 28Pins) :

The main code:

#include <SPI.h>
#include "MCP23S17.h" // github.com/n0mjs710/MCP23S17

MCP outputchip(0, 10); // Chip address is 0 and CS pin is 10

void setup() {
  outputchip.begin(); 
  outputchip.pinMode(0B1111111111111111); // All pins are OUTPUT
  outputchip.digitalWrite(0B1111111111111111); // Set all pins HIGH mode (to power LED)
}

void loop() {
}

The mcp23s17 connections with the Arduino boards:

mcp23s17 Arduino
11 D10
12 D13
13 D11
14 D12

The led should be ON but no :frowning: do you see what is wrong with my setup/code please ? I thank you in advance :kissing:

mcp23s17_test1.ino (416 Bytes)

MCP23S17.h (6.22 KB)

MCP23S17.cpp (9.7 KB)

I can't see the LEDs on the controller boards, are any of them on?

Note that ".zip" files are a security risk in Windoze systems and we do not open them. :roll_eyes:

missdrew:
I can’t see the LEDs on the controller boards, are any of them on?

I plug them out to take the photo

Paul__B:
Note that “.zip” files are a security risk in Windoze systems and we do not open them. :roll_eyes:

Sorry, I edited my first post to add the 3 files directly in the attachments

According to the library's readme, your pinMode sets all pins as inputs

guix:
According to the library’s readme, your pinMode sets all pins as inputs

Indeed, it’s embarrassing… Thank you but it still does not work with this code:

#include <SPI.h>
#include "MCP23S17.h" // github.com/n0mjs710/MCP23S17

MCP outputchip(0, 10); // Chip address is 0 and CS pin is 10

void setup() {
  outputchip.begin();
  outputchip.pinMode(0B0000000000000000); // All pins are OUTPUT
  outputchip.digitalWrite(0B1111111111111111); // Set all pins HIGH mode (to power LED)
}

void loop() {
}

I have tested every jumper and connection, it should work… I don’t understand