Arduinos sind nicht nur AVRs, Arduinos sind auch ARMs, und die haben alle Geschwindigkeit der Welt für sowas.
ich habe aber auch mit meinen ganzen AVRs (Nanos, Megas) noch nie Rechenzeit-Probleme gehabt.
Hier ist ein speed Test u.a. auch für Int und Float Arithmetik auf allen möglichen Plattformen, u.a. auch Arduino megas und Dues:
http://www.mindstormsforum.de/viewto...p=64772#p64772
Code:
HaWe brickbench © test (time: ms) Arduino Arduino Arduino PJRC Teensy Raspberry Pi
Typ, OS, FW, PL, API Mega2560 Due Zero 3.1 B+(2B)/Raspbian
MCU, cpu-Takt AVR/16MHz ARM M3/84Mhz ARM M0/48MHz ARM M4/72MHz 800-1000MHz
Firmware/vers.,Pr.Lang. IDE 1.6x C++ IDE 1.6x C++ IDE 1.6x C++ IDE 1.6x C++ gnu C++, Geany
LCD / TFT (true color) ILI9225 UTFT ILI9341_due (Adafr.ILI9340) ILI9327 NC HDMI,full-HD
screen size tested 240*176 320*240 320*240 320*240 1080*620
==============================================================================================================
0 100000 integer add/subtr 129 8 15 5 1
1 52000 integer multiply/division 1219 7 102 5 3
2 5000 float operations 326 107 397 92 (2)-13
3 Mersenne Tw. PRNG (&,^,>>,<<) 313 7 36 4 2
--------------------------------------------------------------------------------------------------------------
4 matrix algebra (prod/determ.) 244 23 92 19 1
5 int array sort [500] 1366 171 379 110 (46)-88
Code:
float test_float_math() {
float s = PI;
int y;
for (y = 0; y < 1000; ++y) {
s *= sqrt(s);
s = sin(s);
s = exp(s);
s *= s;
}
return s;
}
5x float-ops in dieser loop, die dann 1000x,
also 5000 float operations
in 326 ms auf dem Mega,
und 107 ms auf dem Due...: na und ?
in oberallgeiers prähistorischer Zeit war das vlt mal anders... :-/
Lesezeichen