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. 

U1EX_USB.ASPIC

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. 

U1EX_USB.INS.ASPIC

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. 

U1EX_USB0.ASPIC

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. 

U1EX_USB0.INS.ASPIC

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

U1EX_xxx.ASPIC

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. 

U1EX_xxx.PAS

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

TEST_UIEX.EXE

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. 

U1EX_LIST

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