I am involved in a building healthcare project which needs to monitor the structure vibrations in a resolution of 2000Hz and record it on a micro SD card. To solve the low writing speed on SD, SdFat library was suggested. Using it on an Arduino Mega I reached a record of 1000 Hz. Still not get 2000 but going on with this rate, I want to use an Arduino Nano board to record data. every thing works but recorded data are not valuable. They are all -1 or 256. Since the code is using 512 byte buffers I guessed this buffer is too grate for Nano. Reading the instructions to edit HardwareSerial.h file to increase the buffer size on Arduino Core Codes, I found that this file is used for All hardware. Thus I have doubted if compile settings of buffer was small, why does if work with Arduino Mega?
I will appreciate if someone can explain it to me and any solution to solve this problem:)
As a reference the LowLatencyLoggerADXL345 code is attached.
LowLatencyLoggerADXL345.zip (7.44 KB)