Electronic – arduino – Connect a microSD reader to a LilyPad USB, where are the digital ports

arduinolilypadpinoutsd

I am attempting to connect a microSD breakout board to a LilyPad Arduino USB.
The microSD board has previously been connected to an Arduino Duemilanove.

In the Duemilanove setup, the following connections were made successfully:

(SD) -> Duemilanove

  • (CS) -> Pin 10 (SS)
  • (DI) -> Pin 11 (MOSI)
  • (DO) -> Pin 12 (MISO)
  • (CLK) -> Pin 13 (SCK)

Plus 5 V and ground.

I have attempted to replicate this with the LilyPad USB, following the schematic.

(SD) -> LilyPad USB

  • (CS) -> Pin D17 (SS)
  • (DI) -> Pin D16 (MOSI)
  • (DO) -> Pin D14 (MISO)
  • (CLK) -> Pin D15 (SCK)

However, the problem is, I cannot locate this digital pins physically on the LilyPad USB. I believe they are the six pins in a rectangle formation next to analogue port A2, but I do not know which are which. Following the forum post LilyPad USB v1.1 and SPI, I have tried that combination, but I have not had any results.

What is the order of the six pins? Also, where is the SS pin (that doesn't seem to be included there)?

Best Answer

The programming header will have MISO, MOSI and SCK. Use a multimeter to check continuity from the header to the Atmega32u4 pins.

The mapping between Atmega32u4 and Arduino pin numbers is here. I don't see a digital pin 17 in the mapping, so use a digital pin which exists and change the library. The schematic shows A2, A3, A4, A5, D2, D3, D9, D10 and D11 as the 9 IO pins on the exterior of the pcb, or you could bodge wire directly to another pin of the MCU.