Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: How fast is SDFat Beta actually?

  1. #1
    Junior Member
    Join Date
    Jan 2020
    Posts
    13

    How fast is SDFat Beta actually?

    Hello All,

    I've been playing around with SDFat_beta using the example ExFatLogger code for about 2 months now and it works well to record a single analog input via the onboard ADC on both the t3.6 and t4.0.

    But...I have tried several micro SD cards one of which is supposed to be ridiculously fast but I keep hitting the same 75 kHz limit. I have changed buffer sizes in the code and I am using the dedicated SPI mode but can not seem to get past this speed.

    So my question in can the ExFatLogger code be used to record a single analog signal at 1 Msps on a t3.6?

  2. #2
    Junior Member
    Join Date
    Oct 2016
    Posts
    15
    Can you post an example sketch that demonstrates the limits you're hitting? Maybe it can be optimized with a couple tweaks. Please also include the defines you changed in SdFat. The speed is limited partly due to the fact that the SD cards cannot draw full power or communicate at full speed with any Teensy.

  3. #3
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,645
    It may be only an issue of the example you are using.
    I use SdFat_beta recording 1.2 MByte/s continuously
    Trick is: have ADC run at priority level,use all memory for buffer and write at loop level to disk in, say 16 kByte, chunks.
    Larger speeds is posiible, but T3.6 is not large enough to buffer 130 ms worth of data (130 ms is my design parameter)

  4. #4
    Junior Member
    Join Date
    Jan 2020
    Posts
    13
    Quote Originally Posted by linarism View Post
    Can you post an example sketch that demonstrates the limits you're hitting? Maybe it can be optimized with a couple tweaks. Please also include the defines you changed in SdFat. The speed is limited partly due to the fact that the SD cards cannot draw full power or communicate at full speed with any Teensy.
    Hi Linarism, below are the lines that I changed and below those is the full code as taken from Bill Greiman's SDFat

    Code:
    const uint32_t LOG_INTERVAL_USEC = 15;
    changed from 2000us to 15

    Code:
    const size_t FIFO_DIM = 32*FIFO_SIZE_SECTORS/sizeof(data_t);
    changed from 512 to 32

    Code:
    delta = 0;
    changed from "delta = micros() - logTime; to delta = 0; to get around the "rate too fast" error....yes this is probably dumb but validated results against oscilloscope and allows me to change from 2000us interval to 15us.

  5. #5
    Junior Member
    Join Date
    Jan 2020
    Posts
    13
    Quote Originally Posted by WMXZ View Post
    It may be only an issue of the example you are using.
    I use SdFat_beta recording 1.2 MByte/s continuously
    Trick is: have ADC run at priority level,use all memory for buffer and write at loop level to disk in, say 16 kByte, chunks.
    Larger speeds is posiible, but T3.6 is not large enough to buffer 130 ms worth of data (130 ms is my design parameter)
    Hi WMXZ, I've read a few of the forum posts on here that spoke pretty highly of Bill Greiman's SDFat beta code, so kind of just worked from his example and tried modifying it for my purpose, which worked great...up until 75 000 sps. What's interesting is that I keep hitting the same barrier no matter what I change (SD card, code, etc).

    How many samples are you collecting per second and if possible would you mind sharing your code running at 1.2 Mb/s?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •