Write Speed of SD Card

Hello I intend to use a SD Card to store data in real time. In worst case the data rate goes up to 32kByte / sec. I'm a little confused about the information I found about the SD Card. I found on the datasheet of SanDisk that the block write access time is typically 24ms and 250ms in worst case. As I understand a block is the same as a sector. (512Byte) With these Information I calculate that I can write typically around

20kByte / sec (512/0.024) and 2kByte (512/0.250) in worst case. These low values make no sense to me. (A commercial camera working with SD card needs newer 20 sec. to store a 500k picture to the card). So I think I misunderstand something. What is a realistic write speed to a SD card?

Thank you

Robert

Reply to
leumann2000
Loading thread data ...

Programming Flash cards like SD cards usually involves erase cycles as well as programming cycles. The erase is usually the real time ' consuming one. SD has a Pre-erase command and Multiple block write command.

Also, you should use the parallel (4-bit) mode of SD instead of single bit, if you can.

Rufus

Reply to
Rufus V. Smith

Yes, I had the same problem with MMC cards (see previouse threads....). First, you should consider sustained write speed, and not get confused with interface speed.

If you don't write data continously you may consider burst mode, because SD should have internal ram buffers. (no idea how much ram, and how to use it)

But this speed, has an average value, which is different from its worst case value.

I think it's like writing to hard disks, access time has an average value, but could be each time lower or higher, depending on where the head and sector are. In this case, probably it depends on the internal bank structure of the flash (i.e. if you access adjacent sectors _maybe_ you may write faster!)

The access time can be calculated with data in the internal CSD register, but this is the worst case value used to detect time-out (suggested timeout is 10 times the access time, if I remember).

Anyway, I couldn't find indicative "average" values either.

Anyone else has some ideas/comments/suggestions?

Bye, Aldo

leumann2000 wrote:

Reply to
Haldo

Why? When I try to take a picture my camera will only let me if there is space on the card, it doesn't erase anything to write a new block (or 1000).

tim

Reply to
tim (moved to sweden)

I'm not sure, but I think that he refers to some kind of "low-level" erasing.... I'm far from being an expert, but afaik the sectors of SD have to be erased (and this can be done with different sectors in parallel.....) before being written. It's not related to erasing files (which implies a more abstracted view, filesystems, fat,etc.....)

Right? or not?

Aldo

Reply to
Haldo

In the intended application, does the data get stored in real time until the memory is full, then stop, or does the data continuously get stored until the user stops the storage.

There is a big different, in how you store the data and when you stop. You may want to look back in the sandisk white papers at wearleveling for an explanation why the store times can be so different.

David Brown

Reply to
David Brown

Even on an empty card, it is running a FAT file system, which requires the FAT table and directory structure be updated when saving to the card.

Because the FAT table occupies fixed logical sectors, this means that every update of the FAT requires a movement of all the data on the block into a new block (with the FAT update), and the erasure of the previous block. The same holds true with updated directory sectors.

Rufus

Reply to
Rufus V. Smith

Right, there's internal bookkeeping and sector/block manipulation on all those flash memory type devices. Some do it in the card, some require host support.

Rufus

Reply to
Rufus V. Smith

Depending on the type of operating system you have, the FAT and Directory structures are not updated until the unit is shut down or another event takes place periodically that would cause an update. This is done just for the purpose you point out. If the structure can stay in RAM then it increases the life of the SD Card.

dbrown

Reply to
David Brown

Robert,

A few years ago I experience a problem using Sandisk compact flash that probably explains the timing spec your questioning. I was doing block writes that typically completed in under a 1mS or so - however occasionally the CF device would remain busy for 5 mS and less often 50mS (if I recall). I ultimately tried several CF devices some of which wer "high speed".

Speaking with Sandisk support I was told that the CF device at times needs to move blocks or do some other kind of unspecified processing. During this time you simply can't write data (once a buffe fills?). I tried all kinds of tricks to get around this without success. I don't recall if pre-erase was one of them.

In my case using a AVR Mega128 I had an average datarate of 500K or more, but at times had to wait 50mS to send data. This is a big problem for real time data collection as you have to find a buffer the real-time data while the device is busy.

For my current project I'm looking into using SPI based SRAM for thi buffering as most micros have less than 1K of SRAM.

Good luck, Chris

This message was sent using the comp.arch.embedded web interface o

formatting link

Reply to
dIDEAS

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.