Open source USB stack freestanding demo

in Development by DP | 12 comments

An open source USB stack has been in development in our forum for some time. Up until now it was integrated into the sources code of the specific devices we used like the Bus Pirate, or the IR toy.

Now there is a freestanding demo available that can easily be ported to any PIC with USB. So far there are preset configuration files for PIC18F2550, PIC18F24J50, PIC24FJ256GB106, and their respective families.

It took a bit longer then I expected but i managed to put the usbstack and all the USB hassle into a seperate directory. To include USB support into your project you simply need to include the usb files, adapt a small config file for you need and you are ready to go. This will allow us to have just a single point where changes to the USB stack are done and for you to include it more easily into every project.

So far the stack has been stable, but our data buffering system needs some polishing. If you’d like to help out please head to the forum.

This entry was posted in Development and tagged , .

Comments

  1. someone says:

    This are really good news, but it seems quite crude yet, for real things we will have to use the microchip USB Stack and their license :-(

    My true congratulations to the author of this open USB Stack, it’s real a great and important project, to free us from the nasty microchip stack ;-)

    • Ian says:

      We’re using it in “real things” already :)

      • someone says:

        Ok, my bad, I should said that I’m to lazy to probably go over the extra time to work with this stack, when I’m more familiar with microchip stack and Know +- what it can do.

      • Colin says:

        How long did it take you to learn that stack? I’m quite familiar with it too, and it took ages. I would much rather the single-file include (and I believe I mentioned it ages ago in the forum). I think it would be worth learning the ins and outs of a new stack if it’s open source…

  2. Ray Moore says:

    Question on the demo in the zip file. What is the crystal speed that is configured for? I see two different references, one for 20MHz and one for 16MHz.

    Thanks in advance,

    Ray

    • Ian says:

      Depends on the configuration bits you include. For 18F24J50 it is 16, for 18f2550 it is 20. The stack does not depend on it though, it just runs at the speed set by the configuration fuses you set in MPLAB or the source.

    • Sjaak says:

      It depends on the config words and the used crystal. The config words that are included are crafted for certain board we had lying around: the OLS, IRToy and BPv4.

      Every PIC has some recommendations in their datasheet about which crystal to use and how to set the config words to enable proper USB communications. Eventually we will add this to our wiki..

  3. Ray Moore says:

    Sweet. Working on putting together an 18f4550 test board for it.

    Ray

    • someone says:

      you have to create a linker file for pic18f4550 or you will not have success; to run the demo project I simple created the linker file from the linker file of the pic18f2550, works fine, of course, also changed the config words.

      • tayken says:

        Had to do the same thing. Just tested it out with 18f4550, works great. You also have to enter VID and PID, I just used the ones used at BPv4 for those.

  4. rsdio says:

    Congratulations, folks!

    I have not yet had a chance to review this release, but this is a noble effort that seems to be following through to completion.

    As for the comments about the difficulty of learning a USB Stack, I expect that the first one takes the longest because a lot of the effort is just learning about USB itself. I will be curious to see how long it takes to understand the Dangerous USB Stack, and how efficient it runs on these tiny MCUs.

    • Sjaak says:

      It depends on what you need to do with the stack. I tried to make it as simple to use the basic usb-functions (atm only cdc is supported). then it is a matter fo including all the files and adapt a include files which only contains the pid/vid and strings. I hope to extend this easy way for other things like HID.

      If you want to implement some special something just include the core usb_stack files and write the remaining :)

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

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