Simple PIC USB Interface

Project Info
Author: Chris
Difficulty: Medium-Difficult
Time Invested: 3 Hours

Take a look at the above
tutorials before continuing
to read this tutorial.
           USB has recently become one of the most popular types of communication for devices ranging from consumer products, to industrial robotics and test equipment. The protocol relies heavily on constant contact with devices for error checking which makes it a bit cumbersome, but the end result is stability and high through-put speeds that operating systems love.
           With such popularity, understanding how to communicate with a USB host (like on a laptop) becomes an essential piece of information for anyone wishing to build a USB enabled device.

Simple USB PIC Interface On A Breadboard

USB PIC Interface Action Video

Purpose & Overview of this project
           This tutorial should build a USB interface using a PIC18F4455 that shows up as an HID - Human Interface Device in Windows. The interface should be able to send and receive commands from the USB Host on the Laptop computer. Specifically: The USB should be able to toggle some LEDs on and off, recognize when a switch is pressed and visualize the value of a variable resistor, trimpot.
           USB is a difficult topic to cover, the theory of how it exactly works can fill an entire book. Unlike RS232 serial communication, USB is constantly communicating with connected devices, more similar to Ethernet interfaces. Along with this constant communication, there are many specific values that must be initialized in order for a USB device to be fully activated, these will briefly be described in the theory section of this write-up.