Go Down

Topic: Arduino Mega & Libelium microSD module (Read 3037 times) previous topic - next topic



I try to get an Arduino Mega with a microSD module from Libelium working. I use the sketch from the Libelium site which is meant to be for Arduino Mega.

Now, when I´m using this sketch and press "P" (prints a string to the file, in this case "hola caracola") I´ll get the message "..done" but the hola.txt hasn´t changed. When I press something else, like "L" (lists the file's info, calls the ls("hola.txt") function) I´ll get the message "..error"

I´m using a 2GB microSD card from Sandisk and formatted it under Windows 7 64bit as FAT.

Has Anyone got an idea what the problem could be? Or maybe a way how I can find out what the problem is. Many thanks to you!


I'm pretty sure posting your code will help get the problem solved a little bit faster.


Fistly, the FAT formatting does not support all of your 2Gb on that card. FAT16 is suported (and I think FAT32 is as well). That is probably not your problem though...

Try using a different card (if you have one). I have not used the SDuFAT library on a Mega so I am not sure as to how the code should be altered/what is different...



The SDuFAT code enables the SD module by powering Arduino digital pin 8, as shown in the code:
Code: [Select]

// define the pin that powers up the SD card
#define MEM_PW 8

void setup(void)
 // on my MicroSD Module the power comes from a digital pin
 // I activate it at all times
 pinMode(MEM_PW, OUTPUT);
 digitalWrite(MEM_PW, HIGH);
 // configure the serial port to command the card and read data

Make sure that you have that taken care of.

If this is OK, try the "R" command (read file).


Hi All, I'm new here and I'm having a similar problem.

My hardware setup and library are the same as cachaca's.

I am using the Arduino software 018.
I formatted the microSD card to FAT16 and pasted the holla.txt into the card and then placed the card in the module.

Here's what happens:

1- I load the example program on the Arduino Mega
2- I open up the serial monitor
3- I send out an H, and the help menu shows up

  H help
  L file info
  D delete
  P append string
  W init file and write
  R dump to serial
  A append text

4- I send out a L, and nothing happens. Any key after that does nothing but I see the Rx LED light up in the Arduino, so it does receive the character.

I have to press the power button on the Arduino to try again.

This time, I hit P and it shows:  [hola.txt] - add string

and it again becomes unresponsive.

The same happens with all the other options I choose, except A, which outputs back whatever I type, up to 30 characters, and then becomes unresponsive.

Does anyone have any idea what's going on? is it an initialization issue? reads don't work, file info doesn't work. Please, any insight would be greatly appreciated.

Thank you in advance,



Hi all, I have the same problem here  :o: Arduino Mega + Libelium SD module + SDuFAT. Any help will be very appreciated.


Not all microSD cards supports SPI. This could be your problem. Try another card, preferably a miniSD or SD where all cards has to support SPI.


Check out this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1262386088/18
I've managed to get mine working with the SdFat library: http://code.google.com/p/sdfatlib/updates/list
after a simple modification.


really thanks 8-), I will try the new code and then I'll post any good result....

Go Up