News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

SD Card Optimal Buffer Size

Started by Wimax, Oct 14, 2022, 08:59 AM

Previous topic - Next topic

Wimax

Hello Everybody !

Having to access a file several times writing a certain number of bytes at a time, using the 'append' command, is there an optimal buffer size for writing to SD to speed up the process ?

top204

The FAT routines already use the library's internal buffer of 512 bytes (SD card sector size), and they all operate at a byte level when reading and writing the buffer, so unless you go into the library's code itself and use the internal buffer directly, any size external buffer will perform the same. Epecially with a PIC24 or dsPIC33 devices that have excellent indirect access mnemonics that the compiler makes full use of. :-)


Wimax

Thank you Les !
In fact, doing a few tests I didn't notice any appreciable change, I was hoping for some trick to speed up the saving (transferring 1MB from external RAM to SD takes a while...).