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

Thread: Feasibility of using Teensy 4.0 + Audio Board Rev D

  1. #1
    Junior Member
    Join Date
    Nov 2019
    Location
    London
    Posts
    3

    Feasibility of using Teensy 4.0 + Audio Board Rev D

    Hi everyone :)

    I have this little project on my mind to log ambient noise and acceleration/velocity, to find the correlation between them in a high speed train.
    Essentially, I will be working with microphone, accelerometer (3-axis maybe ?) and microSD card (and also probably with RTC module).

    The requirements are as follow:
    • 40-48kSps for the microphone (mono would do - 1 channel)
    • 300-500sps for each axis of the accelerometer


    I have been working with Arduino (AVR- & ARM-based) before. However, I am currently attracted to Teensy 4.0 as it offers delicious specs. It also has built-in RTC, makes it more pleasing. I am considering to buy. However,

    1. Is the project is feasible with Teensy 4.0 + Audio Board rev D, by just using standard library teensyduino ? Or I need to use DMA for the ARM-based microcontroller to config what I require ?
    2. Given that the number of samples per seconds and assuming two bytes per samples, high likely I need class10 microSD with high write speed isnt it ?

    Thanks in advance.

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,073
    Sounds like the sampling would be okay. Even a Teensy 3.6 should be able to do that. Not sure of the impact of the Audio sampling getting in the way as it should handle that. For sure the accelerometer sampling no issue as a T_3.6 can do and process 9 DOF accel/gyro/mag and combine for good position at 500 samples/sec and the T_4 has more than twice the CPU resources. That was done without writing to SD.

    Only issue would be the rate of data writing to SD card if it was known how long it would take to want to write an accumulated megabyte. The SD write timing may interfere with some sampling? The audio sample of mic possibly not, but perhaps the accel readings? Though rate of change of accel for a train probably not as fast as most objects?

    Assuming you have room and power either T_4 or T_3.6 can also log to a hard disk with USB_HOST and that should offer faster throughput and more uniform write times.

  3. #3
    Junior Member
    Join Date
    Nov 2019
    Location
    London
    Posts
    3
    Thank you for your reply defragster.

    I will be getting T_4 this week and get my hands to it.
    If there is anything I am stucked with, I will refer to forum.

    Cheers

  4. #4
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,359
    Note, in terms of SD card writing, the built-in SC card reader/writer of the Teensy 3.5/3.6 will be much faster than the SD reader/writer on the audio shield. This is because the 3.5/3.6 built-in card reader uses quad-spi (where 4 bits are sent at once) while the SD reader/writer on the audio shield is a standard SPI device that only processes 1 bit at a time.

    But all is not lost, assuming you can do teensy tiny soldering. Underneath the Teensy 4.0 are 8 pads for providing a built-in micro SD card reader equivalent to what the Teensy 3.6 provides. In the General forum, there are at least 3 different breakout boards being designed that will let you attach a micro SD card shell, plus the beta board that Paul previously designed that allowed using the revision C audio shields with the Teensy 4.0 also had a breakout for the micro SD card reader.

  5. #5
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,236
    Quote Originally Posted by MichaelMeissner View Post
    ...the built-in SC card reader/writer of the Teensy 3.5/3.6 will be much faster than the SD reader/writer on the audio shield.
    Good to know, but isn't either fast enough to record mono audio provided you are buffering enough data?

    For a data logging project is that fussy soldering or breakout boards really necessary? And if it is, maybe OP should consider a Teensy 3.6 just to get easier audio logging as I don't think processing speed is likely to be relevant.

  6. #6
    Junior Member
    Join Date
    Nov 2019
    Location
    London
    Posts
    3
    Thank you Michael for the info.
    I will have a look on integrating my upcoming Teensy 4.0 with a microSD reader/writer. However, I am a bit confused about the audio shield.

    The audio shield is meant to record audio data in which in bare minimum should be 40kSps - audible frequency (unless there is other application that can go lower than this). With the audio shield integrated with microSD card reader/writer, and the data recorded is pretty big, why not the audio shield apply the same architecture (ie quad spi) for data writing ? Is it because the audio shield is not really meant to log audio but just to process audio and output it via its DAC ?

    Some other questions:
    1. Does Teensy 4.0 or 3.5/3.6 supports exFAT ?
    2. If not, is it worth it to reformat exFAT to FAT16/32 ? Does the speed is compromise ? Is there significant difference in the speed ?

    Quote Originally Posted by oddson View Post
    For a data logging project is that fussy soldering or breakout boards really necessary? And if it is, maybe OP should consider a Teensy 3.6 just to get easier audio logging as I don't think processing speed is likely to be relevant.
    Unfortunately I have ordered T_4 and it is coming this week. However, I am starting to think that I would not need the audio shield after all once I do the soldering on T_4.

  7. #7
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,398
    Quote Originally Posted by scarlet_bear View Post
    1. Does Teensy 4.0 or 3.5/3.6 supports exFAT ?
    It is not a question of Teensy, but the library you are using
    Suggest to use Bill-Greimans SdFat-beta https://github.com/greiman/SdFat-beta which supports all Teensies and also exFAT

    For normal audio recording the SPI-based Audioboard SDcard is fast enough, but you always can add a sdio-based uSDcard to T4 for demanding performances

  8. #8
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,359
    Quote Originally Posted by scarlet_bear View Post
    Thank you Michael for the info.
    I will have a look on integrating my upcoming Teensy 4.0 with a microSD reader/writer. However, I am a bit confused about the audio shield.

    The audio shield is meant to record audio data in which in bare minimum should be 40kSps - audible frequency (unless there is other application that can go lower than this). With the audio shield integrated with microSD card reader/writer, and the data recorded is pretty big, why not the audio shield apply the same architecture (ie quad spi) for data writing ? Is it because the audio shield is not really meant to log audio but just to process audio and output it via its DAC ?
    Well Paul would have to answer questions of the design constraints of the audio shield. But in general, the audio shield's primary mission is to control and output audio data. Note, the original audio shield was designed when the Teensy 3.1/3.2 was the current Teensy.

    It does have some things for sound input. It has two pins to solder a simple mono microphone for input. It also has a simple micro SD card reader and writer that presumably are meant to hold audio clips. It has a place to solder in a non-volatile RAM chip that can also be used to hold audio clips.

    Now, it depends on whether the micro SD card reader/writer is fast enough for your needs. For doing mono work, particularly coming from a slower Arduino processor, it likely may be fast enough, and you don't have to do fancy soldering to get to it (obviously you will need to do some simple pin soldering to connect the audio shield). But if you find it isn't fast enough, you have the option of using the built-in micro SD card support. However, it is not brought out like the main pins of the Teensy.

  9. #9
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,073
    Quote Originally Posted by WMXZ View Post
    It is not a question of Teensy, but the library you are using
    Suggest to use Bill-Greimans SdFat-beta https://github.com/greiman/SdFat-beta which supports all Teensies and also exFAT

    For normal audio recording the SPI-based Audioboard SDcard is fast enough, but you always can add a sdio-based uSDcard to T4 for demanding performances
    Good Suggestion - I tested that Beta lib yesterday on T4 - with onboard SDIO quad SPI. As noted it can do FAT32 or ExFAT. Write speed is near or over 10 MB/sec on a good formatted card. Average write times are 25-50 microseconds! However there are times when the write can take ~210 milliseconds. That is lower than I have seen on standard SD writes at other times - so there may be some few interruptions - but generally it is good and it may be made better with ExFAT and pre-Allocating. Yesterday on that thread I posted what was shown here - even using 200 MB files.


    As Far as Audio Shield SPI to SD - that shield predates Quad SPI capable Teensy - and that takes extra data lines. On T_3.6 and T_4 they are Dedicated processor lines routed directly to pads specifically for SDIO - fully independent of any other SPI connections.

Posting Permissions

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