Papilio Story

This is the Papilio Story – as told by Jack Gassett at Design West 2013.

This is the Powerpoint Presentation:


This is the Word Doc Presentation:

My love affair with hardware hacking and computers started at the age of 13 when I was given a used Commodore 64 for my birthday. It was purchased from an engineering student at Fresno State University and to my great surprise and delight it had been modified with a reset switch, pause button, and a toggle switch for the fast load cartridge. These mods quickly became the envy of my schoolmates!

The seller threw in a 300 baud modem as an afterthought which sat in a box for several months before it dawned on me what the little beige box was. Once I hooked it to the phone line and heard the sweet dial tones followed by the harsh synchronization sounds of two modems connecting I was instantly hooked! I became very active in the BBS (bulletin board system) scene and made a large group of online friends. Back then it was a common ritual to get together with your online friends to swap software and drink a lot of caffeine! Inevitably these get togethers would expose my modified C64 which always piqued the interest of my online friends. With so much interest in the mods to my C64, a group of my BBS friends got together and we took my C64 apart to figure out how the mods actually worked. After descending on our local Radio Shack and promising that our group of 13-year-olds would not burn down the house if they sold us a soldering iron, we were able to duplicate the mods on a C64 belonging to one of my friends.

This early success provided the spark for what has become a lifetime of hardware hacking. From then on out, there was not a single piece of electronic hardware I owned that was not opened up and modified in some way. In fact, I often bought a new piece of hardware simply because of the hacks that were possible with it!

After many years of quietly hacking and learning in my basement, making things to amuse myself and amaze my friends, I realized that there was a big problem with my approach — none of what I was doing could be recreated. I did them just to do them, after which they ended up sitting on a shelf in my basement and no one could enjoy them.

It was at this point I came to the realization that what I really wanted was to start inventing things. I wanted to design things that had the same “Gee Whiz!” factor as the hardware hacking I had been doing for years, but that could be reproduced so others could hack on things that I had made!

After years of thought, I came to the conclusion that what I wanted to be was an inventor. The problem was that I wasn’t entirely sure how to proceed with this idea! No one was going to hire me to be an Inventor and there was no clear cut path to follow to achieve my goal… All I knew was that I wanted to become an inventor and that I would have to figure out how to make this a reality on my own.

While I was growing up, I devoured every Robert A. Heinlein book I could lay my hands on. In one of these books, an engineer travels back in time, and the first thing he does is build his own tools before he starts inventing things. That always stuck in the back of my mind, so when I decided to become an inventor I figured I needed to do the same thing — that is, I needed to make a platform for inventions.

While I was researching embedded Linux devices, I came across ucLinux running on an FPGA. I was intrigued by the concept of a System-on-Chip (SoC) type of device that could be reconfigured on the fly. As I did more and more research, I began to put all the pieces together and realized that places had building blocks that could be coupled with soft processors to make SoC’s on an FPGA.

This whole concept floored me. You could use a computer to design a system that would have VGA, USB, an SD card, and whatever else you needed, then load the whole thing onto a circuit board that becomes what you designed, all without being locked into a chip that was set in stone and would be obsolete in a couple of years’ time.

At first I thought that maybe I was not understanding everything correctly. Why was this not more widespread? I bought a development kit from Xilinx, quickly got ucLinux up and running on the board, and then I began experimenting with cores from During this learning process, I used a starter kit from Xilinx and cool open-source cores like the Sump logic analyzer to help debug things. Along the way, I began to understand that what I thought was possible was indeed possible, but also that there were good reasons why it was not more widespread.

In addition to the steep learning curve, all the FPGA boards on the market had the same problem I’d experienced when I was doing hacks in my basement, which is that you can’t duplicate your work very easily. The Sump logic analyzer provided a great example of this problem. It’s a great core that was developed and targeted for the Spartan 3E Starter kit. If you are a beginner who is lucky enough to have that starter kit, then you can use this amazing tool. But if you have a different starter kit, you are going to have to invest a lot of time getting over the learning curve before you can port the Sump logic analyzer to the FPGA board you do have.

The other problem is that, as an inventor, if you make something for an FPGA board that you want to share with the world, it is not very practical to buy something like the Spartan 3E starter kit, for example. The reason I say this is that this kit was on a special offer for $99 when I bought it, sometimes it sells for $150, and right now it is selling for $399. Oh, and you don’t need the majority of features that come on that board either. As you can imagine, very few people will use your work with that type of a scenario.

The birth of the Gadget Factory and the creation of Papilio
Based on my experience hacking FPGA starter kits — coupled with my newfound realization that I wanted to be an inventor — I saved up enough money to quit my comfortable but dead-end IT job.

On July 1, 2009, I dove in at the deep end and started the Gadget Factory with the intention of figuring out how to become an inventor! My first task was to follow the advice of the fictional character in one of my favorite books by science fiction author Robert A. Heinlein, which was to make my own platform upon which I would develop my inventions.

My first system, which was based on a Spartan 3E FPFA, was called the Butterfly Platform. The first iteration of this platform was modular — I wanted to stack FPGAs and peripherals on top of a USB module so everything could be upgraded independently. However, I quickly discovered that there were some serious problems with this approach.

As a startup I was also learning about marketing, and one of the first things you discover is that your message has to be simple and easy to digest. For beginners to the world of FPGAs, a modular system becomes one more thing that confuses the message. So I designed a single board that would be easy to understand, like the Arduino.

Since this was a unified design, and I expected it to be the first platform with which I would actually make inventions, I named it the “Butterfly One.”

Shortly after, I ran into the founder of Sparkfun Electronics, Nathan Seidle, and I proudly showed him my new board. Nate’s very important piece of advice was that the name I had selected for my platform was going to cause problems. Apart from anything else, there was already the AVR Butterfly board, which was very popular. Also, the term “Butterfly” is too generic to do well in Google search results.

Taking Nate’s advice to heart, I brought up Google and performed a search for “Butterfly,” only to discover that there were 293 million results. When I refined my search to include “Butterfly” and “Electronics” the result was to find the AVR Butterfly. Nate was right — I needed to come up with a new name.

After searching around for a different name that did not change the whole butterfly concept too much, I found that Papilio is Latin for butterfly. A search for “Papilio” returned less than a million results, which is small by search-engine standards, so I quickly renamed my new board to be the “Papilio One” and I’ve never looked back. Today, the Papilio FPGA board is at the top of a Google search for Papilio! Thanks, Nate!

Goals for the Papilio
My goal for the Papilio was to create a platform for my own inventions, to make a platform that other inventors could adopt for their inventions, and try to figure out how to make FPGAs “beginner friendly.” In the case of my own inventions, I needed a board that was as affordable as possible so I could sell products at a reasonable price. I also needed a platform that could be easily extended with whatever peripherals were required by any new inventions.

In order to satisfy these requirements, I added the “Wing” concept to the Papilio One. This meant that while an invention was being prototyped, you could add functionality à la carte as required, by plugging Wings into the Wing slots. Once you have everything working and you are ready to bring an invention to the market, you create a MegaWing. This is equivalent to an Arduino shield that plugs into the Papilio and provides a package of peripherals that provide a complete solution. Typical examples are the Arcade MegaWing and the RetroCade Synth MegaWing.

Other inventors can standardize on the Papilio and make their own MegaWings. A big advantage of this approach is that they don’t have to deal with trying to use an FPGA vendor’s starter kit that may or may not go away. This is because the Papilio is open-source, so the design is always going to be available.

Another alternative is for people to derive their own products based on the Papilio design. For example, Ian Lesnet and I teamed up to make the Open Bench Logic Sniffer, which was derived from the Papilio One design. By offering a low-cost piece of open-source hardware, we managed to put the Sump code into the hands of tens of thousands of hackers, and that just makes me smile.

The end result is that, as opposed to being at the mercy of a starter kit that is overpriced to begin, that keeps changing prices, that was never intended to be made into a product in the first place, and that may be discontinued at any time, with the Papilio there is now an open-source board that will always be available.

AVR8 Soft Processor

Having a hardware platform is just half of the solution when it comes to making inventions on an FPGA. VHDL is difficult to learn and is cumbersome for certain tasks such as control functionality. It makes much more sense to adopt an Open Source Soft Processor to use as the heart of your inventions. Just like most modern PCB’s are designed around microcontrollers, our designs will benefit from being designed around a Soft Processor. Our control functionality can be written as easy to understand and maintain C code. But we still have the ability to write custom modules to do the heavy lifting for any peripherals we have that need more power.

With this in mind the next task was to adopt an AVR-compatible soft processor from and make it Arduino compatible. The reason for this was to provide a familiar and comfortable environment for beginners to ease into using an FPGA, not to mention that there is a huge base of Arduino code that suddenly works on the Papilio FPGA.

This turned out to be quite a project, there were several Open Source Soft Processors free to download over at but few were in a usable state. OpenCores is much like the Wild, Wild, West of FPGA code. There is a lot of great stuff there, but you are on your own when it comes to making it work. Some projects have great documentation, but many do not. After evaluating several Soft Processors one of the easiest to work with was the AVR Core by Ruslan Lepetenok. After exchanging some emails with Ruslan he told me that the AVR Core had been running as an ASIC design on silicon for several years without any glitches. I knew then that it would be worthwhile to proceed with this core, I adopted a less generic name and started calling it the AVR8.

Arduino IDE

Next up was the fun part! Getting the Arduino IDE to work with the AVR8 Soft Processor on the Papilio Hardware. I wanted to keep my changes to the Arduino IDE as simple as possible so I decided to take the approach of having the Arduino IDE call a Makefile that implemented merging code into a bit file and loading it to the Papilio One board. To accomplish this I modified the Arduino source code by adding two new keys to the boards.txt file, upload.command and upload.using.

I also modified the code that generated the hex file and had it check for the existence of the upload.using key. If it existed then it would copy the Papilio tools into the sketches temporary directory and then transfer control, after the hex file was generated, to the Papilio Makefile. The Papilio Makefile would then take over and merge the hex file into the appropriate bit file and load it to the Papilio board.

I now had a very flexible Soft Processor that opened up the huge Arduino code library for use with FPGA projects! The coolest thing is that it was completely customizable, I ended up adding functionality that let users programmatically shift SPI, PWM, and other pins on the fly to any pin on the Papilio board. I also put together templates and examples to create custom peripherals that were a part of the AVR8 memory space.

ZPUino (Arduino Compatible Soft Processor on Steroids!)

In 2010 I had the great pleasure of meeting Mr. Alvaro Lopes online. He had extensive FPGA experience, particularly with the ZPU Soft Processor. He quickly put together a ZPU design that worked with the Arduino IDE and coined it the ZPUino. The ZPUino solution was vastly superior in every way and has quickly become the preferred solution for the Papilio. While the ZPUino is comparable in size to the AVR8 it boasts some drastic improvements:

  • 32-bit Soft Processor instead of 8-bit for the AVR8
  • Runs at 96Mhz instead of 16Mhz for AVR8
  • Implements many more 32-bit peripherals then AVR8

Probably the most compelling feature is the Wishbone Bus which provides a standardized way of adding peripherals. With the Wishbone Bus we can make peripherals that will work with other Soft Processors and we can use many peripherals from with little modification.


It has been a long but rewarding journey so far, designing the Papilio Platform, implementing the AVR8, and using the ZPUino Soft Processor. While there is no clear cut path to become an Inventor we’ve taken the first steps towards finding a way. Thank you for taking some time to share in those first steps.


Jack Gassett

Leave a Reply