Pages: [1]   Go Down
Author Topic: SD Card on Arduino Nano  (Read 4015 times)
0 Members and 1 Guest are viewing this topic.
Loughborough, UK
Offline Offline
Full Member
***
Karma: 0
Posts: 113
Bloody semicolon
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey all,

Has anyone got an SD card working on the Nano?

I'm trying to use the SD.h library but it doesnt offer much information as you cannot set it to particular pins which is frustrating.  I believe it attaches itself to the Serial.h library, however this is attached to pins D0 and D1, which is the USB line.

Ideally, i'd like to have the SD card on pins D10-13, so I can still use the USB port, however since there is no option to choose what the SD.h latches onto I cant put it on a software serial port (that I know of.

Any ideas?

Cheers,

Simon
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 642
Posts: 50386
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I believe it attaches itself to the Serial.h library, however this is attached to pins D0 and D1, which is the USB line.
Why do believe this? It's wrong.

Quote
Ideally, i'd like to have the SD card on pins D10-13
Good thing that's what you'd like. Because that's where it needs to be connected.

Quote
Any ideas?
About what? Where to go on vacation? Got them.
Logged

Loughborough, UK
Offline Offline
Full Member
***
Karma: 0
Posts: 113
Bloody semicolon
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Glad youre set for holidays!

It is attached to the serial library, as I am using FastSerial.h
http://code.google.com/p/arducam-osd/source/browse/trunk/Library/FastSerial/?r=245
which overwrites the normal serial library.  With this included I get linker errors.  Without it works fine.

Is there a way of having 2 SD cards then, or assigning 1 SD card to different pins...not D10-13??

Ive got it working, but its very slow.  I guess thats because its FAT32?
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 642
Posts: 50386
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
It is attached to the serial library
You can't attach hardware to software.

You should post some code, a link the SD card reader/writer you are using, and a schematic showing how it is connected.

Quote
Ive got it working, but its very slow.  I guess thats because its FAT32?
Or any of a number of other factors. Without seeing any code, or having any idea what you are talking to, or how, we can't offer any more help.
Logged

Loughborough, UK
Offline Offline
Full Member
***
Karma: 0
Posts: 113
Bloody semicolon
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using the standard example from the SD.h reference, and the SD card is directly hardwired to the Arduino, so seeing my code is meaningless.  The question I asked was can you attach the SD card to any pins I decide upon?

And there is a software serial library so yes you can attach hardware to software as I have done with a Xbee to two random pins operating software serial.
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 642
Posts: 50386
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Where on the NewSoftSerial.h file did you plug in the XBee? Don't be silly. You can't connect hardware to software.

If you don't want to describe what SD card you are using, and how it is connected, that's fine. Good luck.
Logged

Loughborough, UK
Offline Offline
Full Member
***
Karma: 0
Posts: 113
Bloody semicolon
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.arduino.cc/en/Reference/SoftwareSerial

It is quite clear that you can assign any receive and transmit pins for software serial.  I have done it, tested it, and have it working fine as per the example in the reference.  Xbee, hardware, connected to a software serial port. Done.


http://arduino.cc/en/Tutorial/Datalogger

As per this example, I have an SD card connected to pins 11-13, chip select is on pin10, which you are free to choose any pin you like.  This workd fine. Done.

My question: has anyone successfully connected an SD card to any other pins, not just the standard 11-13.
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 642
Posts: 50386
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Xbee, hardware, connected to a software serial port. Done.
The "software" serial port is HARDWARE.

Quote
My question: has anyone successfully connected an SD card to any other pins, not just the standard 11-13.
The SD card is an SPI device. It can only be connected to the SPI pins.
Logged

Pages: [1]   Go Up
Jump to: