Case Study in Optimization: Faster SPI on AVRs

Nerd Ralph
March 29, 2015

The Arduino Library provides functions like shiftOut() and digitalWrite().  These functions are simple and effective, but they are slow. Of course, they’re doing a lot more than just toggling bits. Faster isn’t always necessary and can sometimes lead to more difficult debugging.  And as Donald Knuth said,

…premature optimization is the root of all evil.

So what happens, when you do need to optimize? For example, if shiftOut() is too slow for your project, what do you do?  In Ralph’s post, Fastest AVR software SPI in the West, he breaks down different SPI code implementations into their assembly code.

To make the best optimization, you need to change compiler flags. So this is, in my opinion, an interesting case study in what kind of performance benefit you can get when you do some serious optimization.

Of course, you really shouldn’t, unless you need it…

Check out his post: Fastest AVR software SPI in the West

Knuth quote from his paper “StructuredProgrammingWithGoToStatements.”

element14 is running a Design Challenge called Enchanted Objects. The idea is to add magic, or modern technology, into older objects, enchanting them. How could you turn an ordinary household object into something extraordinary?

You can see the content intro video here.

With my recent interest in retro-electronics, an entry by Jan Cumps caught my eye. He’s repaired a vintage record player (turntable) using an Arduino and Pulse Width Modulation (PWM) control. For more information on his work, the project page is here. Jan’s YouTube channel is at pitface123.

Sleep Infographic Using Raspberry Pi and Fitbit API

Paul's Geek Dad Blog
Tuesday, 24 March 2015


The Fitbit API allows you to get data from a Fitbit and use it in your own applications.

Paul wrote a Python script which runs on his Raspberry Pi which extracts the data. Then we processes the data using Excel. Once doing so, he created the above sleep infographic–his first effort.

The interesting aspect here, to me, is the idea of these wearable devices and their data. It is great we have large-scale data creation, but it is even better have access to the data for processing.

Great example of charting out critical health data using easily accessible tools.  Check out Paul’s full writeup with description and code.

Check-out these seven new features in the Arduino 1.6 release

Arduino 1.6.1 Screenshot

The (official) Arduino team has finally released the 1.6 version of the Arduino software. After being in the making for over 2 years, this release is an exciting one!

1.6 marks the end of split releases between the traditional 8-bit boards and ARM based boards. There’s some really cool features built-in, so keep reading to see my take on the good, the bad, and the ugly.

Arduino Compiler for LabVIEW

LabVIEW's 3rd Party Add-Ons

Arduino Compiler for LabVIEW Screenshot

Aledyne-TSXperts, a National Instruments Alliance Partner, has released an Arduino compiler for NI’s LabVIEW. Now it is possible to build a VI and download it into your Arduino.

The price tags from $99 to $499 might seem a bit high to the average hobbyist. However, at least it comes with a 7-day evaluation period. It is also compatible with the Home Edition of LabVIEW.

So if you’re a LabVIEW programmer with an Arduino on your desk, you might want to checkout the Arduino Compiler for LabVIEW.

Five Raspberry Pi Alternatives (via makeuseof)

Christian Cawley @ makeuseof
March 13, 2015

Not to long ago the only question about embedded boards was: Arduino or Raspberry Pi. Which really breaks the question down to “microcontroller” or “microprocessor.” Once you decide on a microprocessor platform, there are a bunch of Raspberry Pi Alternatives to consider.

Of course, no single board will always be the obvious “best.” Heck I’ve even got a pile of them on my bench that I haven’t messed with yet.

The 5 Raspberry Pi Alternatives

Even though I haven’t gotten to them all yet, Christian Cawley at makeuseof put together a nice list of Raspberry Pi Alternatives. So before you dive head first into your project, check out these other boards and see if one better meets your needs.

  1. Beaglebone Black
  2. ODroid-C1
  3. Hummingboard-i1
  4. Minnowboard Max
  5. Banana Pi

Even if you aren’t in the market for a new microprocessor board, you might want to check out the first section of the article. It’s a nice description of what to look for when selecting a board.


Awesome 3D Board (BRD) Viewer for EAGLE

3D Render of MSO Demo Board

3D Render of MSO Demo Board

Earlier I posted a PCB Checklist of items to double-check when sending your board out to a fab. The Dangerous Prototypes blog pointed to a 3D EAGLE PCB tool from a Bulgarian-based developer called Cytec that takes an EAGLE BRD file and renders it in 3D for you.

The example board I have above is a render of my MSO Demo Board. And I have to be honest, it looks much like that one! (more…)

Come See The Baldengineer’s Presentation at APEC 2015


Supercapacitors in Transportation Applications at APEC 2015

The Applied Power Electronics Conference 2015 (APEC 2015) celebrates its 25th year in Charlotte, NC. The conference opens on March 15, 2015 and is focused on power electronics. The schedule of technical sessions range from industry experts to students presenting research papers. APEC’s exhibit floor is usually packed with every vendor in the power electronics supply chain. This is one of the largest electrical engineering shows in North America—and I’m excited to announce I will be presenting in one of the industry sessions!

In this Rockwell Automation video you’ll learn all about their latest Encabulator technology. The presenter goes through each piece of the system expertly describing both its name and its function. Now, since this video is from 2008, it is a little bit older.  And in today’s technological terms, may be difficult to understand.

(BTW, this is what you probably sound like when you try to explain your projects to your friends.)

PCB Checklist – What to check before you submit

PCB Checklist Banner

Recently I’ve been expanding my retro game collection to include game cartridges imported from Japan. The problem is that I don’t have Japanese game systems (yet). So I’m creating an open source adapter to convert Famicom carts to the NES. Before I submit the PCB to OSH Park, I’m going to run through this PCB Checklist to make sure I don’t forget something silly.

This PCB checklist is something I’ve built over my years of creating boards. If you’ve got tips from your own list, don’t forget to leave a comment letting us know.

PCB Production Checklist

The concepts on this list will apply to almost any PCB software. The tips I give relate to EAGLE, since that is what I use most often. Feel free to comment to add tips for other design software like or KiCad.

Keep reading to see the list.

Make sure you also check out the comments, some really great suggestions there too!