Go Down

Topic: SD Card and Arduino Mega 2560 (Read 2 times) previous topic - next topic

catsur

Hi guys,

I am new in programming with Arduino.

I have a project, it is to create a datalogger.

So, I bought this SD card shield : http://www.cooking-hacks.com/index.php/shop/arduino/microsd-2gb-module-for-arduino.html

After some tests, I understood I have a problem because of the Arduino Mega 2560 : I can't connect the SD shield like on a Arduino UNO. So, I follow this : http://www.cooking-hacks.com/skin/frontend/default/cooking/pdf/arduino_mega_Sd.pdf, without success.

So, I am trying to find an other library and an example (the most important for me) for SD Card and Arduino Mega, but don't find it.

If somebody can to explain to me slowly (I am new!), or il somebody have a tutorial, it could be nice, very nice.

Thanks in advance.

and sorry for my english, I know, I am not the best.... :~

Une petite visite sur le site de notre projet? C'est par ici : http://ok24.jimdo.com/
Do you want to learn more about our project? Click her

madepablo

Hi catsur,

I have an older version of this shield working perfectly in my arduino duemilanove. You could use it with your arduino mega, but you need to include some other libraries to connect it in the same position that on the Uno or Duemilanove boards. However, if i am right, in the lower part of the SD shield you have a 2-colums 3 pins conector. Is it right? This id for the ICSP connection. You must connect them directly to the ICSP pins located in the middle of the arduino Mega board. Just only take care, because you MUST also modify the selector located on the higher part of the Sd shield. Now it is connected to 5V and 3.3V. Remove it and connect again to the 3.3 and GND (just the third one previously free). That is all that  you need related to hardware.

About software, you have available different libraries: SD, SDFat, Filelogger,... and so on.

Please, check the links contained in the webpaged you linked in you post, because there you have everything that i explained to you, including schemes and plots of how to wire it to the boards, as well as tutorials.

I hope it could helps you.
Cheers,

catsur

Hey Guys,

My problem is solved!!!

Because on the Mega 2560, MOSI port, MISO port, SCLK port, and SS port are not the same than the UNO, it is not possible to plug directly the SD shield.

I done this drawing on Fritzing, maybe it will help some people like me in the future : http://www.flickr.com/photos/66966632@N03/6097282823/in/photostream.

After, I follow this tutorial, using the standard SD library : http://jeremyblum.com/2011/04/05/tutorial-11-for-arduino-sd-cards-and-datalogging/. Be carreful : You have to change the value of the variable CS-pin. It is 53 on the Arduino Mega.

And sorry for the inconvenience!
Une petite visite sur le site de notre projet? C'est par ici : http://ok24.jimdo.com/
Do you want to learn more about our project? Click her

catsur


Hi catsur,

I have an older version of this shield working perfectly in my arduino duemilanove. You could use it with your arduino mega, but you need to include some other libraries to connect it in the same position that on the Uno or Duemilanove boards. However, if i am right, in the lower part of the SD shield you have a 2-colums 3 pins conector. Is it right? This id for the ICSP connection. You must connect them directly to the ICSP pins located in the middle of the arduino Mega board. Just only take care, because you MUST also modify the selector located on the higher part of the Sd shield. Now it is connected to 5V and 3.3V. Remove it and connect again to the 3.3 and GND (just the third one previously free). That is all that  you need related to hardware.

About software, you have available different libraries: SD, SDFat, Filelogger,... and so on.

Please, check the links contained in the webpaged you linked in you post, because there you have everything that i explained to you, including schemes and plots of how to wire it to the boards, as well as tutorials.

I hope it could helps you.
Cheers,


Thanks for your answer MadePablo. I think I forgot to remove the selector, because that's the only thing I done wrong. For the moment, my method is working well for what I want to do, but I prefer yours, it is more "clean". I will try this later because now I would like to try other thing with the SD Card.

Thanks a lot for your precious help.
Une petite visite sur le site de notre projet? C'est par ici : http://ok24.jimdo.com/
Do you want to learn more about our project? Click her

madepablo

I received help from a lot of other users, so now is my time to help.

In any case, take care with the selector. You must change its position not to remove it completelly. I am not at all an expert on electronics, so maybe it works without the selector when you use the ICSP communiction pins, but is better to change its position and not to remove. In that way you also remains the selector in the shield and you donĀ“t lost it!

Enjoy!

Go Up