Go Down

Topic: Microcontroller I/O & ADC Benchmarks (Read 57288 times) previous topic - next topic

Riva

#30
Dec 08, 2018, 03:25 pm Last Edit: Jun 09, 2019, 08:59 am by Riva
Managed to get my hands on a SAMD21 Zero clone and run the benchmark in #1 after converting references of Serial to SerialUSB and am surprised at how slow it is, especially the analogRead.
I have added results to the first post but for reference here, they are repeated.
Code: [Select]

Arduino Zero I/O Speed Tests Over 50000 Iterations. Compiled Using Arduino IDE v1.8.7
Digital Pin Write Takes About 1.6234 Microseconds.
Digital Pin Read  Takes About 1.0264 Microseconds.
Analogue Pin Read Takes About 423.2541 Microseconds.
Don't PM me for help as I will ignore it.

sblantipodi

it would be interesting to see some comparison between the new nanos and the ESP8266/ESP32...
is there something like this on the net, can't find it?

Riva

Have just done the test on an ESP32

Code: [Select]
ESP32 DoIt ESP32 Devkit V1 (80MHz) I/O Speed Tests Over 50000 Iterations. Compiled Using Arduino IDE v1.8.9 and 1.0.2 Core
Digital Pin Write Takes About 0.1199 Microseconds.
Digital Pin Read  Takes About 0.1642 Microseconds.
Analogue Pin Read Takes About 10.3027 Microseconds.
Don't PM me for help as I will ignore it.

sblantipodi

is there some benchtmark with the new arduinos?

Riva

is there some benchtmark with the new arduinos?
I don't have any of the newer Arduino's. Maybe someone who has can run the benchmark sketch from #4 and post the results here.
Don't PM me for help as I will ignore it.

haresfur

While trying to determine the most suitable MCU for a project that needs fast analogue read I decided to knock up a quick bench-test sketch and run it on some of the various MCU's I have kicking around.
Hope the info is helpful and maybe others can add new MCU's or tests.

Interesting. Do you have any idea why the analog read is so slow for the Zero?

westfw

Quote
Do you have any idea why the analog read is so slow for the Zero?
Apparently the SAMD ADC is configured with a very large "sample time" in addition to the conversion time.
https://github.com/arduino/ArduinoCore-samd/issues/327   (reported nearly 2 years ago.  Has the look of one of those "oops, we made a mistake, but we're afraid to change it for fear of breaking something" bugs :-(  )
Adafruit improved it for their boards:  https://github.com/adafruit/ArduinoCore-samd/issues/51

MarkT

#37
Jul 13, 2020, 01:41 pm Last Edit: Jul 13, 2020, 01:42 pm by MarkT
Teensy 4.0 at several speed settings (needed to change to nanoseconds)

Code: [Select]

Teensy 4.0 (600MHz) I/O Speed Tests Over 50000 Iterations.
Digital Pin Write Takes About 35.50 nanoseconds.
Digital Pin Read  Takes About 33.34 nanoseconds.
Analogue Pin Read Takes About 18623.44 nanoseconds.

Teensy 4.0 (150MHz) I/O Speed Tests Over 50000 Iterations.
Digital Pin Write Takes About 142.00 nanoseconds.
Digital Pin Read  Takes About 132.32 nanoseconds.
Analogue Pin Read Takes About 19351.30 nanoseconds.

Teensy 4.0 (24MHz) I/O Speed Tests Over 50000 Iterations.
Digital Pin Write Takes About 896.50 nanoseconds.
Digital Pin Read  Takes About 834.44 nanoseconds.
Analogue Pin Read Takes About 22173.00 nanoseconds.

[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up