Connect 9 slaves with arduino via SPI communication?

Hi everyone,

I’m having trouble with SPI communication. I want to connect UNO (master) with 9 slaves via MSPI (like MSPI.png picture).

When I connect UNO with 8 slaves, data transfer is OK. But when I conenect more 9th slave, I can’t read data. Data of 8 slaves is wrong. If I disconnect 9th slave, data transfer if OK.

I have attached a code and library files like below.

Can someone please help me? Thanks.

MSPI.png

LTC6802_SPI.ino (10.8 KB)

SPI.cpp (5.58 KB)

SPI.h (10.1 KB)

  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(12, INPUT);
  pinMode(13, OUTPUT);

I’m reasonably confident that the SPI class handles this without your help.

uint16_t au16data[104] = {};

  au16data[104] = ((volt[12] & 0xFF) | (volt[13] & 0x0F) << 8) * 1.5;
  au16data[105] = ((volt[13] & 0xF0) >> 4 | (volt[14] & 0xFF) << 4) * 1.5;
  au16data[106] = ((volt[15] & 0xFF) | (volt[16] & 0x0F) << 8) * 1.5;
  au16data[107] = ((volt[16] & 0xF0) >> 4 | (volt[17] & 0xFF) << 4) * 1.5;

They go together like a hand and a shoe.