Embed Inc PIC 18F USB Framework

Last updated 22 Feb 2008

The Embed Inc PIC 18F USB Framework is a comprehensive set of code for developing full speed USB devices using the PIC 18F USB-capable parts.  Features of the framework include:

To get the framework, go to the software downloads page and install the PIC 18F USB Framework release.  The framework includes the U1EX PIC example application that runs on a USBProg instead of its normal firmware, and the TEST_U1EX and U1EX_LIST host programs.  All source code is in the SOURCE > USB directory within the software installation directory.  The PIC source code uses the Embed Inc PIC development environment

Some key files are listed below.  See their comments or documentation files for the details. 


Low level driver for the PIC USB hardware.  This driver uses software triple buffering with hardware ping-pong buffering.  It exports simple put-byte and get-byte subroutines for application use, along with additional control routines per endpoint depending on configuration. 


Include file that defines the endpoints in use, their transfer modes, and their buffer sizes.  All the remaining code automatically configures itself accordingly using assembly-time logic. 


Endpoint 0 command processor.  Endpoint 0 is reserved for communication with the operating system and the custom driver, and includes the USB enumeration handshaking.  This module is a clean client of the low level USB driver in the USB module. 


Include file used by the USB0 module to define the static data returned to the host during enumeration. 


Other source modules of the U1EX example USB PIC application.  This application uses USB endpoint 1 to implement a bi-directional stream of bytes for communicating with the host application. 


Host source code of the example library that provides basic I/O services to the application level. 


Test program that provides a command line interface for communicating with the U1EX example device.  Individual bytes can be sent and received, with some higher level commands and interpretation of the received byte stream included.  For example, the command LED ON turns on the LED on the target unit. 


Program to enumerate all the U1EX devices connected to the USB.