Ever since I had started my collegiate education, I had been interested in USB. It struck me as something that should be more accessible, as the antiquated serial and parallel ports have quickly gone the way of the dodo. USB offers a myriad of desirable features, including high communication speeds, plug-and-play capabilities, and a compact form factor (goodbye DB9 connectors). Yet, in school, we only ever worked with the serial port. Of course, I can see the rationale, as the serial port is very easy to use and understand, and the basic serial port concepts can be extended to other serial protocols. However, I wanted to go beyond these primitive interfaces and work with something more modern.
This project had a few major objectives that I wished to fulfill:
- Learn about USB at a protocol level and application level
- Learn how to create a custom USB driver on a host machine
- Incorporate hardware and software to make a neat end product
To achieve these goals, I created a USB device that controls a graphical LCD using a USB-enabled PIC18F4550. Moreover, because I wanted to understand more thoroughly the low-level nuts and bolts of USB, I opted to create my own USB stack for the microcontroller rather than using the Microchip-provided API’s. On the host side of things, I created a custom Linux kernel module driver to interact with this USB device. On top of that, I wrote a user-space library and demonstration application to interact with the device through the driver and display some useful information to the LCD. Overall, this project turned out to be the most educational, enjoyable, and cleanest project that I have made. I’m really quite proud of the end product.
In reality, this was actually a school project because it was an independent study. However, I have included it in the ranks of my personal projects because, for all intents and purposes, this had no academic backing other than the fact that I received credit for it. The project was my idea and was completely self-guided. One nice consequence of this being a school project is that it forced me to write a nice beefy report about it. The report is chock full of information about USB and the specific technical details of this project. As a result, rather than rehashing the specifics on this page, I instead urge you to take a look through the report:
(Note that I have looked back through my report since finishing the independent study and have recognized a few erroneous statements in the report, but overall I think that it is a pretty sound document.)