Announcing an open source USB stack for PIC 18F and 24F

Posted on Monday, August 29th, 2011 in open source, PIC, USB by Ian

Good news everyone! A new free and open source USB stack is now available for PIC microcontrollers. Today we finished testing and prepared a simple echo test that works with PIC 18F and 24F. We hope a demo release will get more developers involved. A release package and overview are in the forum. As always, thanks to Honken and JTR for making this possible.

Microchip has a free-as-in-beer USB firmware for the PIC microcontroller, but it can’t be redistributed. For a project like the USB IR Toy, we can give you our source code but not the USB source. You have to get that on your own from Microchip. It’s not a huge problem, but it is a barrier for people new to PICs. We used the Microchip firmware because it works great and there wasn’t an alternative.

Over a year ago we released the first Bus Pirate v4 hardware. It uses a PIC with integrated USB, it needs a USB stack. We think the Bus Pirate exemplifies everything good and wholesome about open hardware. There’s no way we’d release it using non-distributable source.

The road to the open USB stack is strewn with the corpses of attempted ports, and the empty promises of rentacoders who didn’t deliver. Eventually, a solution came from Honken, who contributed the foundation of the USB stack. JTR took from there and baked-up the code we’re using now.  This USB stack would not exist without the herculean efforts of Honken and JTR.

Things are speeding up. A few weeks ago an open source bootloader for the Bus Pirate v4 was finished. Last week we completed testing of a USB IR Toy firmware that uses the new stack. Later today we hope to make the first official Bus Pirate v4 firmware release.

Thanks to everyone who made this possible. If you test the demo please give us a shout in the forum.

This entry was posted on Monday, August 29th, 2011 at 9:37 am and is filed under open source, PIC, USB. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

7 Responses to “Announcing an open source USB stack for PIC 18F and 24F”

  1. zikzak says:

    Whoa ! That’s great ! I’m waiting for some nice tutorials on dangerousprototypes now !

  2. arhi says:


  3. “The road to the open USB stack is strewn with the corpses of attempted ports, and the empty promises of rentacoders who didn’t deliver.”

    Shouldn’t that be:

    “The road to the open USB stack is strewn with the corpses of rentacoders who didn’t deliver, and the empty promises of attempted ports.”

  4. vimark says:

    Congratulations to the team who worked so hard on it!

  5. dsgfds says:


    Hopefully this will be further developed and maintained for integration into all kinds of open source hardware projects.

  6. VaclavPe says:


    I think that USB stack by Alexander Enzmann is open sourced, too. I tried this code and made changes to have bulk USB device and CDC device. It is quite simple.

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Recent Comments

  • Pekka Akselin: This is ridiculous!? :-) We are back at 256(!) byte EPROMs that needed multiple, a handful, of voltages to run! :-(
  • KH: Let's try a back-of-envelope calc balancing energies. From MCP1700 datasheet, there are graphs for a 200mA load step. Estimate the energy shortfall as 12uJ. Say...
  • Daniel: It's been a week and my comment is still awaiting moderation. Apparently the CIA doesn't want their involvement known?
  • KH: Agree, so okay, I guess he must have learned from somewhere. 100nF and 1000uF is so far apart, that was jarring; it's more magic incantation...
  • Max: I have a suspicion the hefty electrolytic cap might be some sort of cargo cult carry-over from other RF-based projects - for instance, I've seen...