Everything for Electronics

Tech Forum





September 2013

Arduino

I've hit the performance wall with my Arduino processor. I'm using the standard development environment and the latest version of the cards from SparkFun. Where do I go from here?

#9132
Sandra Kinney
Madison, WI



Answers

There are a few options for higher performance processors that are moderately compatible with basic Arduinos. My personal favorite is the Maple from Leaflabs.com. Some others are the Arduino Due, and the ChipKIT boards from Digilent. Unfortunately, all of these boards run at 3.3V, which often means changes to external hardware are needed. The Maple and ChipKIT boards have several 5V input compatible digital pins, and 5V analog input is possible using two external resistors.


All three boards will require some modification to anything but the most basic code. The Maple will require the most changes, but also has the best access to hardware features (timers, high-speed ADC, etc) due to those changes. The Due will require the fewest changes, and has the best support for standard libraries. The Maple and Due have the best documentation. If you like the look of these boards, make sure to check that libraries you use will be supported.


If 5V is a must, you may have to consider switching development platforms. Both Atmel AVR and Microchip PIC microcontrollers are available that run at much higher speeds and have better peripheral sets while still using 5V. I'm afraid I don't know as much about the AVR line, but PIC18F, 24F, and 30F are all quite powerful controllers. If you decide to go this route, be warned that the learning curve is very steep at the start. Don't forget to compare performance by MIPS (million instructions per second), not clock speed.


Another 5V solution is to use a second Arduino! Using two board lets you do twice the work at the same speed. You can communicate between them using serial or SPI/I2C with the wire library. This can be a lot of work, but it also may be the simplest solution to some problems. You may also want to simply see if you can improve your coding abilities.


Most people underestimate what can be accomplished with a basic Arduino or microcontroller. For instance, if your code has delay()s of more than 1ms, there is probably a faster way to run the same code. Unfortunately, the Arduino libraries are not really designed for the highest performance. For example, the only interrupts that are available using the core libraries are for pin changes. Many common programming techniques to improve performance rely on timer, serial, and ADC interrupts. If your code isn't proprietary, don't be afraid to post it to the Arduino forums to ask if there is a faster way to do the same thing. If you already use the best practices, they will also be able to point you toward an upgrade that fits most closely with what you need to accomplish.

Sam
Jersey Shore, PA