I'm affraid I can't use SPI, tell me I'm wrong!

Hello :slight_smile:

So I have the Arduino MEGA2560 with a TFT display and it's adapter shield to connect easily the display to the Arduino. On the TFT there is also a SD slot.

Here are the pins used by the adapter shield on the 36 pins connector of the Arduino:

You can see, the SD slot use the pin 53 for SD_CS.

I was randomly reading things on the Arduino main site, and on this page I can read:

On the Mega, the hardware SS pin, 53, is not used but it must be kept as an output or the SPI interface won't work.

I don't care about the Wifi shield as I don't plan to use it, but I don't understand if this line is about just the Wifi shield, or if it's a general information?
Ok I've read on the SPI page:

On the Arduino Mega, this is 50 (MISO), 51 (MOSI), 52 (SCK), and 53 (SS). MISO, MOSI, and SCK are also available in a consistent physical location on the ICSP header; this is useful, for example, in designing a shield that works on the Uno and the Mega.
Note that even if you're not using the SS pin, it must remain set as an output; otherwise, the SPI interface can be put into slave mode, rendering the library inoperative. It is, however, possible to use a pin other than pin 10 (53 in my case?) as the slave select (SS) pin. For example, the Arduino Ethernet shield uses pin 4 to control the SPI connection to the on-board SD card, and pin 10 to control the connection to the Ethernet controller.

But I don't really understand what it said... My SD slot use those 4 pins!

Because I plan to use an DS3234 RTC breakboard, and sensors, which will maybe use SPI, that's why I'm affraid of not being able to use them!

So... Will I have problems using the SD slot + the RTC + those sensors?

Thanks in advance!

Each SPI device needs its own Slave Select line.
If the SD slot uses 53, then your other devices will have to connect to different pins.

SS is for the slave to notify the master of its intent to transmit. It is the opposite of CS.

I am not sure why a SD card needs SS.

SS is for the slave to notify the master of its intent to transmit. It is the opposite of CS.

I am not sure why a SD card needs SS.

Wrong. SS is driven by master, tells slave to clock in data from master, and to clock out slave data.
SS and CS are used interchangeably.

Ok, I am reassured that I can choose whatever pin I want for the other SPI devices :slight_smile: But, in the schematic, does that mean that the SD slot is using SPI?

Now to find a solution to connect those other devices to the same pins 50, 51, 52.. Well I'm far from here anyway, but I like to anticipate things...

Thanks!

Are the other devices shields? Mega size or Uno size? External devices?

I just came up with a Mega Screw Shield, will easily let you take wires from the Mega to external devices.

Pics at Reply #54 here

Have a couple of bare boards available, $13.60 mailed to US locations. If you scroll back up the thread the headers & screw terminals used are listed.

Devices would be external, but I'm not sure to use SPI I would prefer I2C to be honest, less troubles with cables, but maybe I won't have the choice and your mega screw shield will be a good solution then :slight_smile: How much with shipping to France?

France - I don't know, need to check with my wife. She does the packing & shipping & post office runs. There's rules about size and also on flexibility. The card fits in a business envelope, and might be short enough to pass the flexibility requirement. Will let you know tomorrow.

guix,
I'm putting an order together here
http://arduino.cc/forum/index.php/topic,118807.60.html
please jump in and advise if you want a complete kit with headers and screw terminals, or if you will find your own parts and just nee a bare board.

Thanks
Crossroads