BLE UART and Sd card on arduino

Hello,

Is it possible to connect both the BLE UART (https://www.adafruit.com/product/2479) and micro sd breakout board(https://www.adafruit.com/product/254) to arduino promini 3.3V ?

Both of them have to share the SPI pins on the arduino.

I want to store the data on sd card while seeing the data in real time via bluetooth!

Thank you!

dpoornima: Both of them have to share the SPI pins on the arduino.

That is the job of those pins. A swag of different devices can share the SPI bus. All you have to do is ensure their select pins are individual.

Aha! I think there is a complete misunderstanding here. We have yet to see your code but I assume you are using software serial.

You said both have to share the SPI pins. This implies that both are SPI devices, but I believe your post implies that Bluetooth is on software serial. This would mean that Bluetooth does not “have” to share those pins, is not using the SPI bus at all, and indeed using those pins for software serial is not only unnecessary but also a seriously bad idea. This to the point where I cannot believe anyone would be so stupid as to allocate the SPI pins for software serial. All this does is so mayhem and confusion for the likes of you, and there are several other pins you can use for that. To do so is just a matter of changing the connections and calling the pins in the code. I never use software serial but I believe pins 6,7 are the convention.

In short, you should never put a device on the SPI bus unless it is expressly described as an SPI device.

Even if you are not using SPI devices at all, you woyuld do this only as a last resort. Arduinos being what they are, it is something you will surely regret later. I believe it is possible to talk to bluetooth through SPI, you need to ensure that this is what is intended, I suspect it isn’t, and bluetooth is clashing with SD.

CS pins are not part of the SPI bus. You should be able to use any vacant pin for SD’s CS. Pin 4 is the convention, but pin 10 still has to be nominated as OUTPUT, whether it is in use or not. The examples in the IDE demonstrate this.