Getting more serious about DIY electronics and circuitry but don’t have an extensive workbench setup yet? Test equipment is an important part of any workshop, and a digital multimeter (DMM) is one of the most important pieces of test equipment you can own. From measuring current and voltage, to testing capacitors, to waiting for the reassuring “beep” of continuity, you’ll pull out your multimeter for almost every project you build.
Following up on our previous post on understanding floating point math and speed of operations on 8-bit AVRs, we ran across an excellent article today on Arduino math optimization. Alan walks through his implementation of an exponential moving average algorithm. An exponential moving average normally requires floating point arithmetic, but due to the lack of native support on 8-bit AVRs, Alan worked out a way to do it with fixed point math.
After some experimentation, he was able to get his version running quite a bit faster than the floating point version, and offers a detailed writeup and tips along the way. Just as we found in our brief testing, the easiest AVR math optimization is to avoid division, since these processors don’t have a native divide instruction. If you’re looking to squeeze every last drop of performance out of your 8-bit chip and can’t (or won’t) upgrade to something more powerful, check this out for some good ideas.
A post on Embedded Lab that discusses using a CMOS camera for sensing applications caught our eye today. Traditionally, to process the output from a CMOS you need some serious number-crunching power, and common lore holds that most 8-bit microcontrollers aren’t up to the task. However, Ibrahim Kamal from IKALOGIC has written an article that explains how you can use a CMOS to replace rudimentary image or light sensors such as photo diodes.
By reducing the captured resolution, discarding color data, and potentially converting the pixel values to binary information, you can still receive useful input but can parse it with a low-cost, low-power processor. In this way, an 8-bit chip can open the door to basic image processing, allowing for lots of possibilities in robotics or other projects.
The article includes an example that hooks up a CMOS available on Sparkfun (the TCM8230MD) to an AVR XMega. For $10, you have no excuse not to try it in your next sensing project.
Everyone seems to have a snazzy weekly feature these days, and we didn’t want to feel left out. Unfortunately, we could only think of a few catchy names for our series, and it’s not Friday today. Oh well. Consider it a preview publication.
Embedded systems often deal with time critical applications that require maximum performance and minimum execution time. Writing efficient code requires solid study of language and platform fundamentals, and there’s no substitute for concentrated practice. However, there are small tips and tricks to squeeze the last drop of performance out of your programs. Faster code Fridays highlights these techniques so you can implement them into your repertoire. We’ll use Arduino-compatible code for most of our examples, though these techniques will work on a number of platforms.