Harold, It's the sector erases. Normally, an excellent way to reduce erase counts would be to write a=20 bunch of 0xFFs, use 0xFF or 0xFFFF as an end of record marker, and add=20 records using writes only. I tested a few SD cards and I determined that they perform erases at=20 every single write, no matter what data is written. I'm not clear off=20 the top of my head how I determined that, but I was quite convinced at=20 the time. The behavior is probably vendor dependent and unreliable anyway. .... just one more way SD cards suck for embedded. It's a terrible standard. Darron On 4/13/15 8:16 AM, Harold Hallikainen wrote: >> If you hammer an SD card writing a byte at a time (okay a line at a time= ) >> then you kill the writes. > Is there really a problem with writing a byte or line at a time? It seems > the issue is the number of times a sector gets erased. On several systems > I've designed, I log to SPI flash. I have a function prototyped like this= " > > UINT32 ExtFlashStreamProgram(UINT32 Addr, UINT8 *pData, UINT32 NumBytes) > > This returns the next address that would be written. If a byte is about t= o > be written to the first address of a sector, the sector is erased, then > programmed. My logs typically take several sectors (logging goes to > everything not used for something else). > > So, is the issue the number of write instructions, or is it the number of > sector erases? > > Thanks! > > Harold > > --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .