0
\$\begingroup\$

I am writing the data logging portion for a real time embedded application. I have an SD card I communicate via SPI at 33Mhz. I need to be able to log at least 1024 bytes of data ever 1 milli-second. I have tried sending the pre-erase command with 2 blocks erased and then sending the multi-write command with 2 blocks but this takes longer than 1 milli-second. My SD card is rated at 20MB/s so it should be good for 20KB/ms at optimal speeds.

I have tried reading the SD card specification to see how to calculate the optimal write size or sector boundaries and can't tell exactly what to do. Should I be writing in multiples of the sector size at blocks that are multiples of the sector size?

New contributor
TallerProgrammer is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
\$\endgroup\$
0
\$\begingroup\$

fat16lib in the Arduino forum has done lots with SD cards, and has found 512 bytes to be optimal.

\$\endgroup\$

Your Answer

TallerProgrammer is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.