Raspberry Pi Stand-Alone Programmer

Contributors: QCPete
Favorited Favorite 12


Over the past 10+ years, we have used a programmer called the AVR ISP MKII in SparkFun Production. It has served us well, but due to a couple pain points and finally an EOL notice, it was time to upgrade.


At first glance, one might think, "okay, what's the latest programmer from ATMEL? Can't we just swap them out for the old ones?" With our current programming methods, it turned out to be a bit more complicated than that. Also, we do a lot of AVR programming at SparkFun spread across 50+ products, so the problem was actually a pretty big one that needed a reliable and long term solution.

We use batch files a lot in production. If there is an executable GUI that we have to run to program an IC on a product, then we immediately try to find a command line version of that program and automate as much as possible.

With the MKII programmers, our two available options were: Use the GUI (AVR Studio), or do it all in command line. Once you know your commands, then you can put those into a batch file, and a technician can simply double click on a batch file to begin programming - wahoo!! This is how we've done it forever.

(Oldschool Memory Lane Side Note) Well, actually, right as I came on board in 2007, we were manually cutting and pasting the commands from text files into our command line window and reading all of the output to find "Flash verified." Dang, what a pain. I remember thinking, "There's got to be a better way!". Then I went batch file crazy, and three years later did some pretty wonky DIY ganged programming. Look at this beast:

Gang Programming

You can also check out the progression of testing methods here:

Constant Innovation in Quality Control

December 11, 2013

In this article, we share our recent advancements in quality control. Along with making our tests more thorough, we have also made them more efficient and robust.

So all this to say: The problem was bigger than we thought. At the time, each of our programming procedures for AVR chips used a custom batch file that called STK500.exe, that was buried deep within the AVR studio file structure.

After exploring a few available off the shelf products, we quickly fell victim to the classic engineer's curse and thought, "Hey, I could design this better myself!" As it ~~usually~~ always does, this sort of adventure became a long journey.

A stand-alone solution for programming AVR chips has always been a dream of mine. If there was an off the shelf solution (similar to the PICkit3 for PICs), then we probably would have migrated sooner. But there wasn't, so we continued to use the MKIIs. With the day to day stuff and lots of new products coming out, it's tough to make time for these sorts of projects. And so it was this solution (known as the Pi_Grammer around here) that has been a project of mine for almost two years now.

Although, it's not really correct to call it "our own" because it truly builds upon many open source tools that were already available. This is our spin on how to create a stand-alone AVR programmer. So in true open source fashion, here is a tutorial to share what we learned along the way!