data logging system

11 May 2012

hello I'm trying to build a data logging system. my objectives are to get data from sensors, and write this data on a sd card at 25hz. my code is working until 10hz (i can store 10 mesures per seconds), but after i'have some problems of instability I'm using a SPI, and i use a Ticker as interrupt. I mean i attach a fonction to this ticker which i call each 0.04 second. This fonction get tension of 4 AnalogIn pin, open a file using fopen , write date using fprintf and close the file. How could i go to 25 hz ? Thank Mat

11 May 2012

Posting your entire code (at least the interrupt routine), and which SD card you are using would help. I would guess that you can already speed up your code alot if you do not call fopen and fclose everytime in the interrupt routine, I would just keep the file open.