multiple SPI device interfacing with arduino UNO, but working only one at a time

I am trying to interface a RFID-RC522 and a BLE nrf8001 breakout board to arduino UNO,
Both of these work on same vin of 3.3V,different Baud-rate of 9600bps and 115200bps respectively, Both are sharing the same MISO,MOSI and SCLK pins but different RST and SS Pins. The BLE module works great if run independently but as soon as i connect the RFID SPI (SCLK,MOSI,MISO) pins to board the BLE module stops working.
Any links why this is happening and how can i solve this problem.

Thanks
Sumit

what do you mean "different Baud-rate of 9600bps and 115200bps respectively" ? Do you use a SPI ?

If you connect the module, do you set the corresponding CS to in-active as well? If the CS is floating then it might as well think the data on the bus is for the second module.

Do all of the libraries use SPI.beginTransaction() and SPI.endTransaction()? If not, do they call SPI.setBitOrder(), SPI.setClockDivider(), and SPI.setDataMode() before every transfer? Different devices use different settings but the hardware can only be set one way at a time. If the settings are only set once (like in a .begin() function) then any other device might change those settings and keep the first device from working properly.

@septillion the CS for the BLE module is connected in active state and CS of RFID is not connected at all.

@johnwasser SPI.begin is used and settings are set only once, will try using SPI.beginTransaction() and SPI.endTransaction()/SPI.setBitorder,SPI.setClockDivider and SPI.setDataMode() before every transfer.

sumitk5:
@septillion the CS for the BLE module is connected in active state and CS of RFID is not connected at all.

Then that is wrong... With the CS pin of the RFID floating it has NO idea if it needs to ignore the data or see it (and thus drive MISO).

sumitk5:
@johnwasser SPI.begin is used and settings are set only once, will try using SPI.beginTransaction() and SPI.endTransaction()/SPI.setBitorder,SPI.setClockDivider and SPI.setDataMode() before every transfer.

What libraries do you use? Most do some of this internal. And good libraries use the SPISettings() parameter :slight_smile: