Jan Axelson's Lakeview Research


JANAXELSON.COM is live now. (Try it!).
Please update your bookmarks and links.
After June 1, 2014, this site will be available ONLY at janaxelson.com and links to content at lvr.com will no longer work.

Home > USB Complete

USB Complete

The Developer's Guide, Fourth Edition

Jan Axelson

Buy the print book

Buy the ebook

DevMonkey's Jon Titus recommends USB Complete and USB Embedded Hosts.

USB Complete selected for Intel Corporation's Recommended Reading List.

Introduction | Table of Contents |Excerpt | Code | What's new

Reviews and awards | Book data (price, ISBN) | Corrections

USB CompleteFrom the Introduction

This book is for developers who are involved with designing or programming devices that use the Universal Serial Bus (USB) interface. If you are a hardware designer, if you write firmware that resides inside USB devices, or if you write applications that communicate with devices, this book is for you.

USB is versatile enough to serve a multitude of device functions. Familiar USB peripherals include mice, keyboards, drives, printers, speakers, and cameras. USB is also suitable for data-acquisition units, control systems, and other devices with specialized functions, including one-of-a-kind designs. The right choices of device hardware, software drivers and development tools and techniques can ease the path to designing devices that perform their functions without error or user aggravation. This book will guide you along the way. More...

Table of Contents

detailed version (PDF)

1. USB Basics
2. Inside USB Transfers
3. A Transfer Type for Every Purpose
4. Enumeration: How the Host Learns about Devices
5. Control Transfers: Structured Requests for Critical Data
6. Chip Choices
7. Device Classes
8. How the Host Communicates
9. Matching a Driver to a Device
10. Detecting Devices
11. Human Interface Devices: Using Control and Interrupt Transfers
12. Human Interface Devices: Reports
13. Human Interface Devices: Host Application
14. Using WinUSB for Vendor-Defined Functions
15. All About Hubs
16. Managing Power
17. Testing and Debugging
18. Packets on the Bus
19. The Electrical and Mechanical Interface
20. Hosts for Embedded Systems

What's New in the Fourth Edition

The core of USB has remained much the same since the release of USB 1.0 in 1996. But the interface has expanded to support faster bus speeds, improved power management, more device classes, wireless communications, dual-role devices (device and host), and more. Plus, new and improved chips and development tools have eased the task of developing devices and software to access them.

This edition is revised and updated throughout. All new in the Fourth Edition is an introduction to USB 3.0 and the SuperSpeed bus. You’ll also learn how to use Microsoft’s WinUSB driver to access devices that perform vendor-specific functions. Topics with major updates include device-controller chips, technologies for wireless USB communications, protocols for conserving power, and USB device classes.

I provide example code for applications in both Visual Basic and Visual C#. For device firmware, I discuss using both microengineering Labs’ PICBASIC PRO and Microchip Technology’s MPLAB C compiler.

From Chapter 4: Enumeration: How the Host Learns about Devices

One of a hub’s duties is to detect attachment and removal of devices on its downstream ports. Each hub has an interrupt IN endpoint for reporting these events to the host. On system boot-up, hubs inform the host if any devices are attached, including additional downstream hubs and any devices attached to those hubs. After boot-up, a host continues to poll periodically (USB 2.0) or receives ERDY Transaction Packets (SuperSpeed) that request communications to learn of any newly attached or removed devices.

On learning of a new device, the host sends requests to the device’s hub to cause the hub to establish a communications path between the host and device. The host then attempts to enumerate the device by issuing control transfers containing standard USB requests to the device. All USB devices must support control transfers, the standard requests, and endpoint zero. For a successful enumeration, the device must respond to requests by returning requested information and taking other requested actions. More...

Sample Code

My USB Central page has the latest versions of applications and firmware using the example code in the book, plus links to chip and other product information and much more.


USB 2.0's 650-page specification...is nothing if not ambitious. However, just how much useful information any mortal who wasn't involved in writing this tome can actually glean from it without going insane is a different matter. EEs who are interested in a clearer, more concise presentation might do better to obtain a copy of USB Complete, Second Edition. - Dan Strassberg, EDN.

An excellent and highly recommended how-to guide and reference. - Midwest Book Review.

I know I could build the interface myself with the information provided in the two seminal books on the subject: USB Design by Example by John Hyde and Jan Axelson's USB Complete. - Bill Machrone, PC Magazine.

For a very detailed discussion of USB and how to develop custom USB peripherals, check out USB Complete by Jan Axelson. - TJ Byers, Electronics Q&A, Nuts & Volts.

A great job of presenting the difficult topic of USB peripheral development. - Karl W. Pfalzer, Book Review of the Week, www.enterprise-zone.com.

The author has a flair for taking complicated information and making it readable, interesting, and informative. This is the best book on the topic. I recommend it highly. - Jon Titus, Test & Measurement World.

Jan Axelson has done it again. The subtitle of this book is Everything You Need to Develop Custom USB Peripherals, and the book lives up to its billing. If you want to add the Universal Serial Bus (USB) to your repertoire, then this is the book for you. - Joseph J. Carr, Nuts & Volts.

A readable and comprehensive book that covers all aspects of actually building and coding USB devices. Jan's description of building a HID-class peripheral is the best around. - Jack Ganssle, Embedded Systems Programming.

This is the best, clearest, single source of USB information I've yet seen published. It's unusual to find such an easy-to-read style combined with real meat. - Lane Hauck, Member of the Technical Staff, Cypress Semiconductor

I tell all my students that they really need this book in their library. - Paul E. Berg, instructor, Annabooks USB Developers Workshop

Many books are full of things that are easy to find out, and skirt around the harder stuff, which you have to really work at. What I really like about this book is that Jan has obviously slogged at the difficult stuff as well. - Dave Wright, Applications Engineer, Cypress Semiconductor

USB Complete provides a great groundwork for anyone working with USB for any purpose, whether it is designing a peripheral or creating host software. This book should be read by anybody getting started with USB. - Joshua Buergel, BSQUARE

If you intend to use USB in your next project I highly recommend USB Complete. This book will give you an complete overview and help you to get started with USB firmware as well as hardware. - Christer Johansson, High Tech Horizon


USB Complete was a nominee in Books24x7's third annual Referenceware Excellence Awards.

USB Complete won an Excellence Award in the Technical Communication competition of the Society for Technical Communications, Twin Cities chapter.

Book Information

Price: $54.95
504 pages, 7x 9 in.
Publication date: June 2009
ISBN 978-1931448086
Where to buy
Distribution (for bookstores and wholesalers)


Out of Print Editions

(Corrections no longer updated for these editions.)

USB Complete Third Edition (ISBN 1931448027, 2005). Corrections.
USB Complete Second Edition (ISBN 0965081958, 2001). Corrections.
USB Complete (ISBN 0965081931, 1999). Corrections.

Partner Links