More than 4 MCP23S17 on 1 SPI bus I would like to use 7 MCP23S17 as output expanders on one SPI bus. Every IC has its own address from 0 to 6. The first MCP23S17 can be written with no problem. The second chip did not work properly. The CS pin of the MCP23S17 is set like at the all other 4 ICs.

Does anybody have experience with more then 4 MCP23S17 on SPI? Could anyone help?

#include &lt;SPI.h&gt;
#include &lt;MCP23S17.h&gt;

MCP A(0, 10);
MCP B(1, 8);
int d = 250;

void setup() {
  A.begin();
  B.begin();
  for (int k = 1; k &lt;= 16; k++) {
    A.pinMode(k, OUTPUT);
    B.pinMode(k, OUTPUT);
  }
}

void loop() {
  //////////// ON THE LIGHT ONE BY ONE  FROM BEGGING
  for (int f = 1; f &lt;= 16; f++) {
    A.digitalWrite(f, HIGH);
    delay(d );
  }
  for (int f = 1; f &lt;= 16; f++) {
    B.digitalWrite(f, HIGH);
    delay(d );
  }
  ////////////  OFF THE LIGHT ONE BY ONE  FROM BEGINNIG
  for (int f = 1; f &lt;= 16; f++) {
    A.digitalWrite(f, LOW);
    delay(d);
  }
  for (int f = 1; f &lt;= 16; f++) {
    B.digitalWrite(f, LOW);
    delay(d);
  }
}
MCP A(0, 9);                              
 MCP B(1, 8);
 MCP C(2, 7);                              
 MCP D(3, 6);
 MCP E(4, 5);                              
 MCP F(5, 3);



CS on pin 10 is often used for Ethernet
CS on pin 4 is often used for SD