Welcome! Log In Create A New Profile

Advanced

SD read write tutorials?

Posted by Dylan 
SD read write tutorials?
January 24, 2009 04:29AM
I am looking for a good tutorial on reading and writing to the SD card. I would like to be able to write a standard txt file that I can open on the pc.
I am currently using PICs in basic, but have started venturing into the Sanguino (for generation 2 or 3) which I guess is Arduino compatible. I would also like to be able to make the card readable from my hardware to the pc with it's usb cable, but that's a luxury I might put aside.
Any ideas?

thanks.
Re: SD read write tutorials?
January 24, 2009 05:53AM
Some days ago, I was looking for this, too. I found out that interfacing an sd-card seems to be quite difficult - You have to handle the Sd-Card itself, FAT16 and all the files.

But there is a nice library that does all this stuff here: [www.roland-riegel.de]
I also think that Bruce Wattendorf is working on this stuff, isn't he?
Bruce, did you already managed to get the sd card working?
Re: SD read write tutorials?
January 24, 2009 09:22AM
I just got a cheap commercial compiler that has SD library functions included.

[www.mikroe.com]

Mikroelektronika has compilers in C, Basic and Pascal. I use their Pic Basic compiler but they also have ports to other microcontroller families, AVR being one of them. Their library functions are the most extensive I've seen.


-------------------------------------------------------

Hell, there are no rules here - we're trying to accomplish something.

Opportunity is missed by most people because it is dressed in overalls and looks like work.

Thomas A. Edison
Re: SD read write tutorials?
January 24, 2009 01:29PM
thanks guys, that's a really good starting point.
I'll let you know how it comes
Re: SD read write tutorials?
January 24, 2009 03:38PM
[elm-chan.org] Is a good place to start for how to setup the card and the basics of communicating with SD.

There are also some good tutorials and Libraries on AVRFreaks,net forums. Use the search function. This question gets asked a lot.
Re: SD read write tutorials?
January 24, 2009 10:18PM
Hello all

I have been working on this for the last week off and on. I have found 3 different libraries they are all very close here are the links and some comments on what I have found.

[www.ladyada.net]

the first was Lady ADA's this was the Arduino wave shield library it is very good but it is not made for .txt files.



[code.google.com]


This one I found it was a replacement for the Lady ADA's GPS shield. I found that this was smaller then the wave shield library Zach's library.

[reprap.svn.sourceforge.net]

this was one that zach has done some work on. The test code he has made works very well it could use code added to list all files in the root directory. (the original lady ada has that code.)

As far as what I have done so far.

I have tested these and have found that the 2nd one works very well and so does Zach's I have not been able to read a line at a time and get it to work with the Gcode software.

My goals have been to be able to list the file that are on the SD card and also read a gcode file line by line so the Gcode software can process. I think any of these will be able to do this.

Bruce Wattendorf
Re: SD read write tutorials?
January 25, 2009 05:24AM
FAT16 means that you cant put SDHC in the machine, so you're limited to 2 Gb.

I am not a guru with programming pics, stopped learning programming langues when vb6 turned over to .net but i got this idea:

- Read the file letter by letter, and put them in a memory slot.
- When coming to the character 10 or 13(enter key), execute the text in the memory slot.
- Start over until character is 3 (EOF).

This could be easy done by the reader that Tobi suggested. Note that the reader position does not return to the home position (thus creating a loop)
Re: SD read write tutorials?
February 08, 2009 10:27PM
The original SD card firmware, on which the LadyAda and Zach's firmwares are based, has been updated to support FAT32 and SDHC:
[www.roland-riegel.de]

I just tested the new version on a Motherboard:
[www.flickr.com]

My dirty hack is here:
[reprap.svn.sourceforge.net]

Cleanup pending.
Re: SD read write tutorials?
February 11, 2009 09:41AM
Marius, nice hack!

I look forward to trying to replicate your results.

I'm looking for the mini-SD-card component (to put the SD card in). I prefer the one that is compatible to Zach's RepRap Motherboard (which you also seem to be using). I was intending to have a couple of them manufactured. It seems Zach has already had some produced?! I'm very interested in using a motherboard due to the clean wiring and such. After moving my RepRap once again it's broken (loose connection somewhere). I've moved it around a lot. Too much actually, but hey, it is a machine to show off with winking smiley!


Regards,

Erik de Bruijn
[Ultimaker.com] - [blog.erikdebruijn.nl]
Re: SD read write tutorials?
February 11, 2009 12:57PM
I do know Zach has a 2nd revision on the motherboard. I think he is going to or is having them made now or when he gets back from Spain.

Bruce
Sorry, only registered users may post in this forum.

Click here to login