SD Logger + Motor Shield

by maddhat on Sat Nov 17, 2012 10:37 am

Using Arduino Uno + Motor Shield and have the SD Logger connected using the terminal block board. As pin 12 is reserved for the motor shield, is there any way to re-direct which pin the SD card is to use within software? I have D12 on SD card connected to D09 on the arduino. My goal pinout:

D02 --> GREEN LED(sd D4)
D03 --> RED LED (sd D3)
D04 --> MOTORSHIELD
D05 --> stepper
D06 --> stepper
D07 --> MOTORSHIELD
D08 --> MOTORSHIELD
D09 --> sd D12
D10 --> sd D10
D11 --> sd D11
D12 --> MOTORSHIELD
D13 --> sd D13
14 --> sensor1
15 --> sensor2
16 --> sensor3
17 -->
A4 --> rtc
A5 --> rtc
maddhat
 
Posts: 10
Joined: Sat Aug 13, 2011 8:15 am

Re: SD Logger + Motor Shield

by adafruit_support_bill on Sun Nov 18, 2012 9:47 am

It is possible to talk to the SD card via software SPI using different pins. This link has a sketch that uses software SPI to do logging on a Mega.
User avatar
adafruit_support_bill
 
Posts: 28177
Joined: Sat Feb 07, 2009 9:11 am

Re: SD Logger + Motor Shield

by maddhat on Wed Nov 21, 2012 11:29 am

Did you intend to add a link to the previous comment?

Also, I'm using an Uno, not a Mega.

Thank you.
maddhat
 
Posts: 10
Joined: Sat Aug 13, 2011 8:15 am

Re: SD Logger + Motor Shield

by adafruit_support_bill on Wed Nov 21, 2012 12:21 pm

Sorry about that. Here's the link: viewtopic.php?f=31&t=27245
Also, I'm using an Uno, not a Mega.

Software SPI works on the Uno too. If you can't use the hardware SPI pins, software SPI allows you to re-map it to other pins.

In the case of the Logger shield, there is one more issue: The SPI MISO signal is hard-wired to pin 12. You will need to cut either the pin or the trace and add a jumper to the pin you will be mapping it to.
User avatar
adafruit_support_bill
 
Posts: 28177
Joined: Sat Feb 07, 2009 9:11 am