Go Down

Topic: Fast serial to SD card data logger (Read 4762 times) previous topic - next topic

fat16lib

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 http://code.google.com/p/beta-lib/downloads/list.

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.

CrossRoads

Whoa, crankin'!
Can it do the same speeds for data arriving via SPI?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

robtillaart

Impressive work fat16lib - better call you fast16lib ;)

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


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

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

CrossRoads

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!
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Loudhvx


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?

pito


Loudhvx

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

skyjumper

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...

fat16lib

SdFat for Arduino 1.0 is here http://code.google.com/p/sdfatlib/downloads/list.  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.

skyjumper


SdFat for Arduino 1.0 is here http://code.google.com/p/sdfatlib/downloads/list.  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!

brantel

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!

Go Up