Feasibility of using Teensy 4.0 + Audio Board Rev D

Status
Not open for further replies.
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.
 
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.
 
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
 
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.
 
...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.
 
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 ?

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.
 
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.
 
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.
 
Status
Not open for further replies.
Back
Top