Pages: [1]   Go Down
Author Topic: Moving SPI pins ?  (Read 1196 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ?
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 148
Posts: 6104
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What SD reader are you using?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27352
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Leave them there with D10-13 defined as inputs, and just add jumpers.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...

Logged

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27352
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't forget the SS pin has to be an Output pin also, whether its used as SS or not.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: