Pages: [1]   Go Down
Author Topic: SD Card and Arduino Mega 2560  (Read 1897 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

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

Offline Offline
Sr. Member
****
Karma: 0
Posts: 445
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

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

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

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

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

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

Offline Offline
Sr. Member
****
Karma: 0
Posts: 445
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: