Teensy 3.5: FPU limited to 32-bit / ADC speeds?
// update: please note that the title was misleading (I meant 32-bit) and I mixed up two topics (both were on my mind but the distinction was not as clear as I intended it to be). Fixed the title - thanks everyone for the really helpful answers!
Hey everyone,
I just received my Teensy 3.5 and did a few checks. What I did notice right away is that the FPU seems to work only on float variables. This is what a simple check gave me (Arduinos left here for comparison):
My question is simple: I'm using standard Arduino code (e.g. analogRead()) - am I missing something (like one of the libraries for the Teensy) that will speed things up? (The speeds I'm currently achieving are fine for my current use-case, but it would be good to know)
Note: The code I'm using is linked in my blogpost with speed-comparisons for Arduino Uno/Due and Teensy 3.5 boards or here.
// update: please note that the title was misleading (I meant 32-bit) and I mixed up two topics (both were on my mind but the distinction was not as clear as I intended it to be). Fixed the title - thanks everyone for the really helpful answers!
Hey everyone,
I just received my Teensy 3.5 and did a few checks. What I did notice right away is that the FPU seems to work only on float variables. This is what a simple check gave me (Arduinos left here for comparison):
Code:
Time for floating-point operations:
in seconds per million / ms per thousand / ns per operation
Uno (float) Due (float) Due (double) T_3.5 (float) T_3.5 (double)
+ 9.09 1.26 1.87 0.04 1.13
- 9.19 1.26 1.88 0.04 1.13
* 9.69 0.80 1.70 0.04 0.83
/ 30.82 2.74 10.62 0.12 5.55
Time for ADC (analogRead), same units as above:
Uno (10bit) Due (10bit) Due (12bit) T_3.5 (12bit) T_3.5 (13bit)
aread 112.0 4.3 4.1 8.4 20.2
My question is simple: I'm using standard Arduino code (e.g. analogRead()) - am I missing something (like one of the libraries for the Teensy) that will speed things up? (The speeds I'm currently achieving are fine for my current use-case, but it would be good to know)
Note: The code I'm using is linked in my blogpost with speed-comparisons for Arduino Uno/Due and Teensy 3.5 boards or here.
Last edited: