"async write" SD card access, filesystem library (Teensy 3.6)

Status
Not open for further replies.

sakurasanta86

New member
Hello everybody!! I have a question about existing SD card access libraries for the Teensy. I tried the "standard" library, and also "Sdfat". Looks like SDFat is faster, but sometimes when I'm writing the info I'm getting delays up to 20 ms. The data rate is not big - 10 kb/sec maximum. I'm trying to log some info onto SD card, but sometimes (not very often) the "write" function take some significant amount of time. Do you thing there is any possibility to make the "write" function work in an async way - maybe like UART, in order to not wait for this function to complete? Maybe such possibility was already implemented somewhere?

Best regards,
 
im just gonna throw this out there for curiosity sake, but a possible idea for future
I’ve created an SPI_MSTransfer library that supports hooking up multiple teensies together running at 30mhz bus.
what you could probably do is send the payload (100dword transfer currently is about ~51uS to transfer at 30MHz to the slave, excluding processing). 100 dwords is 200 bytes. so i estimate about 110uS or so to transfer a 512byte block write to the slave and have the slave write it to its SD card while your host runs full speed. I’ve developped a queue system as well that you could queue up your SD writes and the slave will write them all to SD in series fashion. This is just an example of what you can offload at the cost of only ~110uS without needing to worry about the latency of SD on master side, you’d run full speed

again, im just throwing the idea out there, its up to you to go with it :)

also, if your only writing a few bytes at a time, youll prolly get away with ~ 1 uS or less, which is way faster than the SD latency. of course, you can’t fix SD latency, thats a card issue itself, the queue system with a slave gets rid of that issue for you

Tony
 
Status
Not open for further replies.
Back
Top