Microchip has USB software to support USB on 8-bit, 16-bit and 32-bit MCUs. This software is royalty free source code and also includes example projects.

The 8-bit PIC18 family supports USB device mode. The 16-bit and 32-bit products with USB support device mode as well as embedded host and On-The-Go. All product families support up to full-speed operaTIon (12 Mbps).

Download the USB framework which includes USB firmware for the microcontroller as well as a USB device driver for the PC which allows the PC to treat the microcontroller as a USB device. Classes supported include HID and CDC.

PIC18F (8bit) & PIC24F (16bit)

 MCHPFSUSB Framework – MCHPFSUSB  is a distribuTIon package containing a variety of USB related PIC18 and PIC24F firmware projects, along with other USB related drivers and resources intended for use on the PC. The USB embedded host stack is API compaTIble with the USB Device and Embedded Host Stack for PIC32. All release notes are included in the .zip file bundle.

Demos include Device CDC demo, CDC serial emulator, device composite HID and mass storage, generic driver demo, HID mouse demo, HID keyboard demo, SD card reader, SD data logger, thumb drive data logger (host) and much more.

 

MCHPFSUSB Framework v1.3 (legacy version) - MCHPFSUSB is a distribuTIon package containing a variety of USB related PIC18 firmware projects, along with other USB related drivers and resources for use on the PC.  This version is not recommended for new designs.

 

PIC32 (32bit)

 USB Device and Embedded Host Stack for PIC32 - Includes class driver examples for HID, MSD, CDC, and Custom. The host stack is API compatible with the PIC24F USB embedded host stack located in MCHPFSUSB Framework v2.x. All release notes are included in the .zip file bundle.

PIC32 USB Device/Embedded Host