The SD Card examples use the SPI interface which uses the MOSI, MISO and SCK pins. The same is true of the NRF24L01 WiFi modules. I want to create a Nano configuration that uses both WiFi and an SD Card, but I am unclear about how accomplish this.
Some articles I have read indicate that multiple CE pins are allowed and can be shared, so the inference I am making is that I could have the SD card use one CE pin and the WiFi interface use another.
I have some working SD card management code that uses five of the six vertical male pins at the end of the board and I have working WiFi code that uses pins 11,12 and 13 for MISO, MOSI and SCK.
I am looking for guidance on (1) whether what I want to to is possible and if so, (2) how to wire the two interfaces.
rhj4:
Some articles I have read indicate that multiple CE pins are allowed and can be shared, so the inference I am making is that I could have the SD card use one CE pin and the WiFi interface use another.
The SPI bus pins (MISO, MOSI, SCK) can be shared. Each device must have a separate CE pin.
rhj4:
I have some working SD card management code that uses five of the six vertical male pins at the end of the board and I have working WiFi code that uses pins 11,12 and 13 for MISO, MOSI and SCK.
On the Nano, the SPI pins on the "six vertical male pins at the end of the board" (the ICSP header) and pins 11, 12, 13 are both connected to the same pins on the Nano's ATmega328P. It makes no difference which of those you connect your SPI devices to.
Also remember to make pin 10 an output, and once you do that it might as well be a select pin for one of the devices.
From what I read, pin 10 is the Arduino's own select pin, ie to make it a slave to some other master device, but the SPI library doesn't support an Arduino being a slave. If pin 10 is an input, you run the risk of inadvertently making your Arduino master into a slave. So if you make it an output, that can't happen.
edit: At least, that's the way I understand things
I just completed a project to use a rf24 radio to send data from an SD card to another device (2D plotter). I bought a micro SD module from Amazon to use for the project. The SD module and rf24 worked fine by themselves, but would not together sharing the SPI bus. Long story shortened, the culprit was the SD module. There is a level shifter on the module to shift the 5V signals to 3.3V for the card. The MISO signal runs through the level shifter (on those modules) and as such does not properly release the MISO line so ties up the bus. I did some searching and found that the Adafruit SD card module MISO line bypasses the level shifter. I built a module following that schematic and everything works great.