Implementing USB On PIC24

picusb

We want to implement USB on our PIC24 based embedded system.

Hardware: All done
Firmware: USB part is currently Non-existent
My role: Make it all work
Questions: The protocols are very complex

Please point me to relevant sources of info.

The specific chip is: PIC24FJ256GB210.
It will be a "device", and I don't think it will ever be a host, even a host-to-go
I have previously spent time at these places…

A tutorial, here: http://www.usbmadesimple.co.uk/ums_5.htm

Microchip's forums, here: http://www.microchip.com/forums/

The USB Implementers Forum, here: http://www.usb.org/developers/docs/

Jan Axelson's site, here: http://www.lvr.com/usbc.htm and purchased her book "USB Coomplete"

The firmwware in the embedded device is what I need to write. The protocol is what I need to research the most. Pointers invited and welcome.

Protocol, Protocol, Protocol; that is what nobody can explain.

Best Answer

The PIC24 has a decent couple of demos in the Microchip Libraries for Applications (MLA). For help on the circuitry necessary, check out the microchip pictail board and the explorer 16 board. All microchip demo boards include a full set of schematics to help you get off the ground running. The usb protocol is generally taken care of for you in the USB stack that's included in the MLA. The configuration is mostly accomplished by setting up your USBDescriptor.c file (see the included demos in MLA and the Microchip USB Device Firmware Framework User's Guide).

All that's usually required code wise after that's done that is to call USBTasks() in a main loop after calling USBInitialize once before your main loop. Then it's a matter of sending and receiving USB data which will depend on how you've configured the stack.

The code for microchip's demo applications included in the MLA is a great starting point. Their licensing terms allow you to using it in commercial products royalty free (as long as you're using a microchip uC of course).

http://www.microchip.com/mla

http://www.microchip.com/AC164131