PIC16 & PIC18 USB Stack

A easy to use USB stack for PIC16/PIC18

Similar projects worth following
Back in early 2017 I decided I wanted to know how to use the USB peripheral in PIC microcontrollers. I looked through microchip's MLA USB examples and found the API was easy to use, but the underlying code was not easy to follow (lots of files to keep track of). So I decided it would be an interesting exercise to write my own stack... I stumbled across Voja Antonic's Supercon II badge project and thought it was really cool. I particularly liked how the badge could be plugged into a computer and the computer would see it as a USB drive, and you could program it by dragging and dropping your intel hex file onto it. The EXPRESS dev boards from microchip use similar code. I was so inspired I set my first major goal to make a similar MSD bootloader. Little did I know how much was involved lol... I firstly made a HID stack with examples, followed by MSD and bootloader (see USB uC), then lastly CDC...

Enjoy this project?



Joshua Grupp wrote 04/12/2020 at 00:44 point

If a *.hex file is placed in this as a USB, does it get reprogrammed with the code?

  Are you sure? yes | no


[this comment has been deleted]

Johnny wrote 08/12/2019 at 03:37 point

Hey Larry, 

sorry I missed your comment. I hadn't made plans to conform to any coding standards. The stack was originally an exercise for myself, to learn about USB protocols and the PIC's USB peripheral. So I originally didn't intend to release it publicly, and especially not as an alternative to Microchip's stack or others.

I've had several people ask about how I got MSD to work on the PIC16F145X (because microchip's MLA doesn't support it) and if I could share the code. So I decided to release the stack with examples, why keep it all to myself?

I'm definitely not a professional programmer, I program as part of my day job, and the stuff I make seems to work lol, but I'm not overly confident in my skills as a programmer, so I'd advise others to use the "tried and tested" stacks for professional work, and mess around with mine if they're curious.

 If you want to modify the code and get it to conform to BARR-C:2018, please go for it and let me know how it goes. Could be a good foundation for a "professional" stack. I don't really have the time or need to do it myself.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates