2
\$\begingroup\$

How do I figure out if a microcontroller has enough processing speed to handle particularly "intensive" tasks?

Specifically, I am a university student looking to design a robot that uses OpenCV and a LADAR. Our team has an ODROID X2. I figure the ARM is fast enough but how can I make sure?

\$\endgroup\$
  • \$\begingroup\$ You find an ARM system that is much faster, port the code, and find out. \$\endgroup\$ – Ignacio Vazquez-Abrams Aug 22 '14 at 16:44
  • \$\begingroup\$ @IgnacioVazquez-Abrams Is trying it out really the only way? Time is limited and if I could have the foresight to not go down a long road towards a dead end, that would be ideal. \$\endgroup\$ – Ninja48 Aug 22 '14 at 16:48
  • 1
    \$\begingroup\$ That board is 'based on Exynos4412 Prime 1.7GHz ARM Cortex-A9 Quad Core with 2GB memory'. You can not get much better than this, perhaps with some small intel i5/i7-based board. \$\endgroup\$ – venny Aug 22 '14 at 16:56
  • \$\begingroup\$ Wow, yeah, that's a big board. I can't see there being a problem with that unless the code is terrible. \$\endgroup\$ – Ignacio Vazquez-Abrams Aug 22 '14 at 16:57
  • \$\begingroup\$ Cannot give you direct answer, just some info. I have OpenCV on i5 PC and Raspberry Pi (Linux, about 850MHz?) connected with USB web cam. CPU load vary hugely depending on which function you call in OpenCV. Have not done myself, I read web blog by people who tested and reported Raspberry Pi working at 3 to 5 frame per seconds, at 640X480 resolution, with typical application of finding a color block. PC is much faster. Do you mean Lidar (or Ladar)? \$\endgroup\$ – EEd Aug 22 '14 at 20:03
2
\$\begingroup\$

Oftentimes performance is not limited by the pure processing speed of the CPU, but instead other bottlenecks in the system - RAM, Flash, Serial I/O, etc. This becomes more of an issue with more complicated peripherals. While you may be able to theoretically compute processor load, this is very, very difficult. The right way to do this is to use benchmarking. Test how much your LIDAR interface and other interfaces require, and also (this is very important) continue to test throughout the development process so if processor usage spikes after a certain feature is added then you can go back and figure out whether there's a better way.

At the end of the day though, Hardware is cheap - when in doubt go big.

\$\endgroup\$
  • \$\begingroup\$ Fully agree with the last line, especially true if it is University research work and one never knows what the works may turn out to be. (OP does not stated Grad or undergrad) \$\endgroup\$ – EEd Aug 22 '14 at 20:22
1
\$\begingroup\$

You can run a simulator and run code benchmarks on the simulator. Or run code on an eval board with a comparable processor and do benchmarks there.

I don't know what OpenCV and LADAR are, but I assume you're compiling the code yourself, so you should use the same compiler you'll be using for the target processor.

Even if it appears to run, you really want to know how much margin you have so some tiny change won't break the code. If you have access only to an eval board it's possible to do crude things like toggle an output pin when the processor is idle, in which case the average output voltage can be used to roughly determine how much of the processor bandwidth is still available.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.