peteculmer
New member
Hi,
I'm looking for some guidance on current 'best practice' in logging data to the (internal) SD card on a Teensy 3.6.
As background, the project involves gathering data from an array of I2C sensors, storing either ~400 or ~800 bytes per 'read' (total data from the array of sensors) @ 100Hz to the internal SD card of the Teensy. This would be for maximum 5 minutes - so not a huge file size or data throughput.
I've read around the forums and looked at various examples - all of which have been very helpful - but left me slightly uncertain about which direction to go with the current state of libraries available for this kind of operation. The closest and most recent relevant example seems to be this:
https://forum.pjrc.com/threads/43834-Real-low-latency-logging-for-Teensy-3-5-3-6-SDIO-SD/page2
And so I'm looking for advice on:
a) Library: should I use the default SD library (comes with Arduino, with optimisation for Teensy?), SDfat (as in example above) or the new SDFS (does this supercede SDfat?)
b) Filesystem: FAT32 on the SD card seems ok for this application?
c) Preallocated data file - is this preferable to maintain consistent (and higher) data rates?
d) Any 'fancy' buffering or padding of data before using file write (to make into 512 /1024 byte chunks? I'd prefer to keep the code 'simple/readable as possible'!
I'm a reasonably competent programmer - happy to spend time developing - but before committing time want to make sure I choose a sensible route
Any comments, advice etc very much appreciated,
cheers
Pete
I'm looking for some guidance on current 'best practice' in logging data to the (internal) SD card on a Teensy 3.6.
As background, the project involves gathering data from an array of I2C sensors, storing either ~400 or ~800 bytes per 'read' (total data from the array of sensors) @ 100Hz to the internal SD card of the Teensy. This would be for maximum 5 minutes - so not a huge file size or data throughput.
I've read around the forums and looked at various examples - all of which have been very helpful - but left me slightly uncertain about which direction to go with the current state of libraries available for this kind of operation. The closest and most recent relevant example seems to be this:
https://forum.pjrc.com/threads/43834-Real-low-latency-logging-for-Teensy-3-5-3-6-SDIO-SD/page2
And so I'm looking for advice on:
a) Library: should I use the default SD library (comes with Arduino, with optimisation for Teensy?), SDfat (as in example above) or the new SDFS (does this supercede SDfat?)
b) Filesystem: FAT32 on the SD card seems ok for this application?
c) Preallocated data file - is this preferable to maintain consistent (and higher) data rates?
d) Any 'fancy' buffering or padding of data before using file write (to make into 512 /1024 byte chunks? I'd prefer to keep the code 'simple/readable as possible'!
I'm a reasonably competent programmer - happy to spend time developing - but before committing time want to make sure I choose a sensible route
Any comments, advice etc very much appreciated,
cheers
Pete