Go Down

Topic: Moving SPI pins ? (Read 1 time) previous topic - next topic

hamiljf

The SD reader has SPI at pins 10-13 (eg, for Uno) and I want to use it on a Mega (pins 50-53).  I'm just about resigned to chopping off the pins and rewiring them, but is there another way ?

SurferTim

What SD reader are you using?

CrossRoads

Leave them there with D10-13 defined as inputs, and just add jumpers.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

hamiljf

Good idea that, should have thought of it myself.  Leave them as inputs and don't read them.  The shield is from iteadstudio.com: SDCard Shield v1.0.

fishermans

Hello,

yes you can use the "Arduino SdFat Library". This library has the posibility to change the pins
(Software SPI). But its not very fast...


hamiljf

Just to conclude and pass on a hint.  Eventually got around to testing this approach with a standard Ethernet card on an Arduino Mega and found the following works...

jumpers...
Mega pin 50 to card pin 12
Mega pin 51 to card pin 11
Mega pin 52 to card pin 13

setup() { ...
pinMode(11,INPUT);
pinMode(12,INPUT);
pinMode(13,INPUT);
SD.begin(4);
Ethernet.begin(...

I expect the same would work for the card I mentioned.


CrossRoads

Don't forget the SS pin has to be an Output pin also, whether its used as SS or not.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up