Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
SD Card Module (HCARDU0008) 
Author Message
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 649
Post Re: SD Card Module (HCARDU0008)
The simple answer is that most SD cards are designed to interface to 3.3V TTL logic levels and that you should include a level shifter if you need to interface to 5V levels. However saying that we have directly interfaced to many types of SD cards with 5V TTL and never seen any problems. So it is up to you, it's very unlikely that you will damage your SD card but it is a possibility.

We do also sell a microSD module that includes level shifters.

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Fri Oct 25, 2013 8:49 am
Profile

Joined: Thu Mar 06, 2014 1:08 pm
Posts: 8
Post Re: SD Card Module (HCARDU0008)
Does the sd card module support the sandisk ultra sdhc cards?


Thu Mar 06, 2014 1:11 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 649
Post Re: SD Card Module (HCARDU0008)
We haven't tested this module with this particular version of SD card. We can confirm that it works with a amongst other cards, a 4GB HC SanDisK and a 32GB HC Transcend. This is a passive reader and so long as your SD card supports SPI mode there should be no reason why it would not work with this reader.

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Thu Mar 06, 2014 5:11 pm
Profile

Joined: Thu Mar 06, 2014 1:08 pm
Posts: 8
Post Re: SD Card Module (HCARDU0008)
I'm unable to get the reader to work on my arduino mega 2560. Below is my setup. The card never initializes.

Ive tried using the 3.3 and the 5v supply pin and both grounds.
The SD card is formatted to FAT32 by a windows 7 PC Tool

MISO - 50
MOSI - 51
SCK - 52
CS - 53

And the code (from the arduino website with the pin cs pin changed to 53 to match the board):

#include <SD.h>

File myFile;

void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}


Serial.print("Initializing SD card...");
// On the Ethernet Shield, CS is pin 4. It's set as an output by default.
// Note that even if it's not used as the CS pin, the hardware SS pin
// (10 on most Arduino boards, 53 on the Mega) must be left as an output
// or the SD library functions will not work.
pinMode(53, OUTPUT);

if (!SD.begin(53)) {
Serial.println("initialization failed!");
return;
}
Serial.println("initialization done.");

// open the file. note that only one file can be open at a time,
// so you have to close this one before opening another.
myFile = SD.open("test.txt", FILE_WRITE);

// if the file opened okay, write to it:
if (myFile) {
Serial.print("Writing to test.txt...");
myFile.println("testing 1, 2, 3.");
// close the file:
myFile.close();
Serial.println("done.");
} else {
// if the file didn't open, print an error:
Serial.println("error opening test.txt");
}

// re-open the file for reading:
myFile = SD.open("test.txt");
if (myFile) {
Serial.println("test.txt:");

// read from the file until there's nothing else in it:
while (myFile.available()) {
Serial.write(myFile.read());
}
// close the file:
myFile.close();
} else {
// if the file didn't open, print an error:
Serial.println("error opening test.txt");
}
}

void loop()
{
// nothing happens after setup
}


Tue Mar 11, 2014 11:36 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 649
Post Re: SD Card Module (HCARDU0008)
I've been taking a look at this and I'm seeing some odd behaviour. The above code works perfectly on an Uno (with the CS pin change) but on a Mega it it gives the card initialisation error. However resetting the mega and then inserting the card into the reader whilst the "Initializing SD card..." message appears makes the code work. It's almost like something on a Mega, or the code/library when running on a Mega, is causing the card to get into an unknown state.

Could you confirm you see the same thing when inserting the card at this point?

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Wed Mar 12, 2014 2:04 pm
Profile

Joined: Thu Mar 06, 2014 1:08 pm
Posts: 8
Post Re: SD Card Module (HCARDU0008)
I'm not seeing this with mine. I might not be catching it at the right point in the initiation but it continues to fail. Is the microSD reader any more reliable to use?


Wed Mar 12, 2014 6:42 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 649
Post Re: SD Card Module (HCARDU0008)
The problem with the SD card reader is that it is effectively a passive device (a breakout board for an SD socket) and doesn't include level shifters. This if fine for 3.3V development boards but when used with 5V boards like the Mega, a level shifter should really be added. The SDRamps module was actually designed to work with a Mega and includes a level shifter. The above sketch will work perfectly SDRamps module.

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Thu Mar 13, 2014 12:51 pm
Profile

Joined: Thu Mar 06, 2014 1:08 pm
Posts: 8
Post Re: SD Card Module (HCARDU0008)
Ok, I'll give one a try if you can confirm it will work with my set up.

Is this the correct module?
http://www.ebay.co.uk/itm/microSD-SD-Ca ... 20d9a23b58


Thu Mar 13, 2014 1:42 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 649
Post Re: SD Card Module (HCARDU0008)
Yes, I happen to have one set up right now with a mega and your posted sketch works without any modification. That is indeed our current eBay listing.

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Thu Mar 13, 2014 4:04 pm
Profile

Joined: Tue Jul 22, 2014 7:46 pm
Posts: 1
Post Re: SD Card Module (HCARDU0008)
If it's any help, I too was experiencing issues with the reader, on a mega, but found this was due to me using a MicroSD card and adaptor, though it may have just been a bit picky. Using an oldd 2GB Kingston SD card then worked fine.


Tue Jul 22, 2014 7:48 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 20 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Thank you to phpBB.com & phpBB.ro.
Design created by Florea Cosmin Ionut.
© 2011 All contents of this site are © Hobby Components LTD