Go Down

Topic: SPI SD card write speed tweaks (Read 1 time) previous topic - next topic


Hi guys,
I am currently playing with an Arduino and a SD card. Using a pre-made serial thing to write to it seemed not enough geeky to me, so I want to use arduino`s SD library.

I found this thread (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1293689213) were a user shows how slow this writing method is and the is advised that "There's been a recent thread on speeding up write times. Perhaps take a look at that. Sounds like it can go much faster", I looked for that thread but didnt found it.

May someone explain me how to make SPI writing to SD faster? Or where I can find a discussion about that?

Thankyou very much


I also noticed that the writing time isn`t realyl affected by how much stuff i write. It takes 40ms to write "asd linea di valori che bello la nonna ha fatto la pasta" and it takes 45ms to write that thing TEN TIMES, assuming that it is provided to the write function all at once, in pretty long array. If I call the write function ten times seprately it takes 400ms to write it ten times. May someone please explain this to me? (and move the thread in the "storage section" if you think it is the case to do so)
Cheers! ;)


I've not used SD cards but AFAIK there is a fixed overhead for a write, doesn't matter if you write 1 byte or a 1000 (maybe be limited by a page size).

So the idea is to accumulate data until you have enough to make the write worthwhile.

Rob Gray aka the GRAYnomad www.robgray.com


This effect is really easy to see with the SdFat benchmark example.  The default buffer size is 100 bytes, try setting that to a full block(512) instead and see your benchmark results increase.

Go Up