Teensy 3.5

199 views
Skip to first unread message

KPerks

unread,
Jul 20, 2021, 10:32:07 AM7/20/21
to Bonsai Users
Hello all,

It looks like there are a few threads about Teensy in this forum, so at least some folks are using them as well with Bonsai. But I do not see any conversations about sampling rate or bit depth. 

I would like to use Teensy instead of Arduino for an analog acquisition task because it has a (MUCH) higher sampling rate. I have the Teensy 3.5 with StandardFirmata installed. Bonsai recognizes it and I am able to read analog input. However, I cannot set the sampling interval to less than 1ms (the property field only accepts int). I would like to set it to much lower than this (for example. 0.025 ms to achieve 40kHz sampling rate).
As far as I understand, the Teensy ADC is capable of this. How can I change the CreateArduino node property field to accept this? (And will it interact with the Teensy via USB communication to have the effect I think it will)

I would also like to be able to set the ADC bandwidth on the Teensy (to specify 13bits instead of 10bits, for example). Would this be a possible property of the CreateArduino node?

Thanks!

KPerks

unread,
Jul 20, 2021, 10:32:53 AM7/20/21
to Bonsai Users

KPerks

unread,
Jul 20, 2021, 10:41:17 AM7/20/21
to Bonsai Users
I did find this Conversation in the forums, which makes me think that maybe I should be using Serial Read to achieve faster rates instead?
https://groups.google.com/g/bonsai-users/c/n8DJVXZa6CM/m/v38WWYKFAQAJ
In this case, my understanding currently is that would program the Teensy itself to do an anlogRead and offer a serial println at the rate that I would like, correct?

On Tuesday, July 20, 2021 at 10:32:07 AM UTC-4 KPerks wrote:

João Frazão

unread,
Jul 20, 2021, 12:51:47 PM7/20/21
to KPerks, Bonsai Users
You are right, teensy is better, It may be possible to change firmata on the teensy to interpret that int as useconds? And change the sampling rate in the teensy. To test this you don't need to make a new bonsai node you can use the standard one. For the bit deep I do not have ideias.

--
You received this message because you are subscribed to the Google Groups "Bonsai Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bonsai-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bonsai-users/527ffe67-d862-4dfd-a1f0-e311fcde25a1n%40googlegroups.com.

Gonçalo Lopes

unread,
Jul 25, 2021, 3:53:58 PM7/25/21
to João Frazão, KPerks, Bonsai Users
Looking at the specification of the Firmata protocol, the analog message should support up to 14-bit dynamic range:

So in theory there shouldn't be any issue receiving messages from the Teensy ADCs. Re. sampling rate, probably the easiest is to do as Joao said and simply reinterpret the units of the sampling interval as microseconds rather than milliseconds in the Firmata code you are uploading to Teensy.

Let us know how this works out for you.

Reply all
Reply to author
Forward
0 new messages