SPI Bus Devices

Hello,

can anybody tell me if it's possible to have more than one device on the SPI bus, please?

Being that it's a bus, I assumed it was possible, but I can only get one device to work at a time...

I'm using an RFM69 module on a breakout that uses SCK, SDO, SDI, SEL and an IRQ connection - I'm also trying to use an SD breakout that uses all the same pins, except the IRQ.

I should be able to just connect both breakouts to the same pins, shouldn't I? Just for reference, are these the correct pins when using the SPI library?

IRQ -> D2
SCK -> D13
SDI -> D11
SDO -> D12
SEL -> D10

I'm note sure if the IRQ connection is part of the SPI bus or not...

Thanks for any suggestions

:slight_smile:

can anybody tell me if it's possible to have more than one device on the SPI bus, please?

Yes, we can. Yes, you can.

Just for reference, are these the correct pins when using the SPI library?

For one device, yes. Every device has its own slave select pin. 11, 12, and 13 are common. 10 says that the Arduino is master, by being an OUTPUT. 10 can be used as a slave select pin, too.

I'm note sure if the IRQ connection is part of the SPI bus or not...

It is not.

Each device on the SPI bus must have it's own SS/CS line - this lets the devices know which device is selected. All the other lines are shared.

Mark

Ah, I see - thanks for that.

I assumed the SPI bus was more like the I2C bus and each device had an address.

Do you know how do I define the pin I'm using for the SEL line? I'm using both the SD.h and SPI.h libraries - is it defined in the SD.h?

Thanks :slight_smile:

...actually, no sooner had I typed that than I realised how to do it and why it wasn't working.

Thanks for your help - I've got my code logging to my SD card now - brilliant :slight_smile:

Thanks :slight_smile: