Fast serial to SD card data logger

I have posted a program that can log data from a serial port to an SD card.

This program can log data at 57,600 baud when used with a 328 Arduino and at 115,200 baud when used with a Mega Arduino.

The logger uses a new serial library that allows large RX buffers and has better error checking than the standard Arduino HardwareSerial driver. This allows data overrun errors to be detected so you can be sure data is not being lost.

The data logging program, the new SerialPort library, and a modified version of the SdFat SD library are posted as SerialLoggerBeta20120108.zip here Google Code Archive - Long-term storage for Google Code Project Hosting..

I use a 1024 byte RX buffer on a 328 Arduino that provides 174 milliseconds of buffering at 57,600 baud and a 4096 byte RX buffer on the Mega that provides 347 milliseconds at 115,200 baud. A few SD cards may fail on 328 Arduinos since the SD spec allows occasional write times of 250 milliseconds. My experience is most SD cards can log sustained data at 57,600 baud on a 328 Arduino.

Whoa, crankin'!
Can it do the same speeds for data arriving via SPI?

Impressive work fat16lib - better call you fast16lib :wink:

Can it do the same speeds for data arriving via SPI?

IIRC SDcards use SPI too. So there might be some interference ?? ...

Seperate Input & output registers; have to see what fat26lib says.
115,200 is fast enough to do dual 16 bit stereo at 44.1K samplling each side, that's what I'm after, my own digital sampler.

Then playback only on a trigger later ... electric drums!

CrossRoads:
115,200 is fast enough to do dual 16 bit stereo at 44.1K samplling each side, that's what I'm after, my own digital sampler.

That would be nice. Just curious... how do you figure that?

2x16x44100=1.4112MBit/sec :astonished:

Right, that's what I calculated. So how would I get 1.4Mbit/sec on 115K baud?

Hi SdFat, is your SdFat library for Arduino 1.0 available as a standalone download? I didn't see it in your list, although i did notice the library for digital pins!

Thanks...

SdFat for Arduino 1.0 is here Google Code Archive - Long-term storage for Google Code Project Hosting.. The file is sdfatlib20111205.zip.

A newer version, SdFatBeta20120108.zip, is included with the Serial Logger and I will soon post it as the current version for 1.0.

fat16lib:
SdFat for Arduino 1.0 is here Google Code Archive - Long-term storage for Google Code Project Hosting.. The file is sdfatlib20111205.zip.

A newer version, SdFatBeta20120108.zip, is included with the Serial Logger and I will soon post it as the current version for 1.0.

Awesome, thank you!

I would like to thank fat16lib for his awesome libraries and samples to get me going on an extreme serial data logger!

Those with data logging/serial projects need to investigate his work!