The developer's resource for computer interfacing, especially USB, serial (COM) ports, mass storage, and embedded networking. (Formerly Lvr.com)

Home > USB Complete

USB Complete

The Developer's Guide, Fifth Edition

Jan Axelson

USB Complete 5th Ed

Available now!

Buy the print book

Buy the ebook

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

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

From 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.

The USB interface is versatile enough to serve just about any device function. 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 help you design devices that perform their functions without errors or user aggravation. This book will guide you along the way. Read more

Table of Contents

View detailed version (PDF)

Introduction
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: Capabilities
12. Human Interface Devices: Reports
13. Human Interface Devices: Host Application
14. Using WinUSB for Vendor-Defined Functions
15. Using WinUSB’s System INF File
16. Using Hubs to Extend and Expand the Bus
17. Managing Power
18. Testing and Debugging
19. Packets on the Bus
20. Electrical and Mechanical Interface
21. Hosts for Embedded Systems

What's New in the Fifth 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 delivery and management, more device classes, wireless communications, support for embedded systems that access USB devices, and more. New and improved chips and development tools have eased the task of developing devices and the software to access them.

This Fifth Edition is revised and updated throughout. New topics include an introduction to USB 3.1 and SuperSpeedPlus, enhanced power delivery and power management, new abilities using USB Type-C connectors, designing devices that use the WinUSB driver without requiring a vendor-provided INF file, new device classes, and how to use free debugging tools.
Much of the information in this book applies to any device hardware and host computer. The example code for applications uses Visual C#.

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-facing 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 TPs (Enhanced 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, standard requests, and endpoint zero. For a successful enumeration, the device must respond to requests by returning requested information and taking other requested actions. Read 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.

Reviews

(Reviews are for previous editions.)

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

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

Awards

(These awards were for previous editions of USB Complete.)

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

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
524 pages, 7x 9 in.
Publication date: March 2015
ISBN 978-1-931448-28-4
Where to buy
Distribution (for bookstores and wholesalers)

Corrections

Out of Print Editions

(Corrections are no longer updated for these editions.)

USB Complete Fourth Edition (ISBN 978-1931448-08-6, 2009). Corrections.
USB Complete Third Edition (ISBN 1931448027, 2005). Corrections.
USB Complete Second Edition (ISBN 0965081958, 2001). Corrections.
USB Complete (ISBN 0965081931, 1999). Corrections.