Lakeview Research home > USB Complete
USB Complete
Everything You Need to Develop Custom USB Peripherals
Third Edition
by Jan Axelson
Introduction | Table of Contents |Excerpts | Code | Third Edition Info
Awards and Reviews | Book Data (Price, ISBN) |Corrections
How
to Get the Book
More retailers and additional ordering information
From the Introduction
This book is for developers who design and program devices that use the Universal Serial Bus (USB) interface. My goal is to introduce you to USB and to help you get your devices up and communicating as quickly and easily as possible.
The USB interface is versatile enough for a wide range of peripheral devices. Standard peripherals that use USB include mice, keyboards, drives, printers, and audio/video devices. USB is also suitable for data-acquisition units, control systems, and other devices with specialized functions, including one-of-a-kind designs.
To develop a device with a USB interface, you need to know something about how the interface works, what tasks your device firmware must perform to communicate on the bus, and what class drivers and other support are available on the host computers that your device will attach to. The right choices of device hardware, device class, and development tools and techniques can go a long way in avoiding snags and simplifying what needs to be done.
If youre involved with designing USB devices, writing the firmware that resides inside USB devices, or writing applications that communicate with USB devices, this book will help you along the way. (read more...)
Table of Contents
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: Using Control and Interrupt Transfers
12. Human Interface Devices: Reports
13. Human Interface Devices: Host Application
14. Bulk Transfers for Any CPU
15. Hubs: the Link between Devices and the Host
17. Testing and Debugging
18. Signals and Encoding
19. The Electrical Interface
20. Dual-role Devices with USB On-The-Go
Index
Chapter 1: A Fresh Start
What if you had the chance to design a peripheral interface from scratch? Your wish list would likely include these qualities:
- Easy to use, so theres no need to fiddle with configuration and setup details.
- Fast, so the interface doesnt become a communications bottleneck.
- Reliable, so that errors are rare, with automatic retries when errors occur.
- Versatile, so many kinds of peripherals can use the interface.
- Inexpensive, so manufacturers and users dont balk at the price.
- Power-conserving, to save energy and extend battery life in portable computers and devices.
- Supported by the Windows and other operating systems, so developers dont have to write low-level drivers to communicate with the peripherals.
The Universal Serial Bus (USB) has all of these qualities. USB was designed from the ground up to be an interface for communicating with many types of peripherals without the limits and frustrations of older interfaces.
Every recent PC and Macintosh computer includes USB ports that can connect to standard peripherals such as keyboards, mice, scanners, cameras, printers, and drives as well as custom hardware for just about any purpose.
This chapter introduces USB, including its advantages and limits, some history about the interface and recent enhancements to it, and a look at whats involved in designing and programming a device with a USB interface. (read more...(PDF))
From Chapter 4: Enumeration: How the Host Learns about Devices
One of the duties of a hub is to detect the attachment and removal of devices. Each hub has an interrupt IN endpoint for reporting these events to the host. On system boot-up, the host polls its root hub to learn if any devices are attached, including additional hubs and devices attached to those hubs. After boot-up, the host continues to poll periodically to learn of any newly attached or removed devices.
On learning of a new device, the host sends a series of requests to the devices hub, causing the hub to establish a communications path between the host and the device. The host then attempts to enumerate the device by sending control transfers containing standard USB requests to the devices Endpoint 0. All USB devices must support control transfers, the standard requests, and Endpoint 0. For a successful enumeration, the device must respond to each request by returning requested information and taking other requested actions. (read more...)
Sample Code
My USB Central Web page contains the latest versions of applications and firmware using all of the example code in the book, plus links to chip and other product information, and much more.
What's New in the Third Edition
Since the publication of USB Complete Second Edition,
much has happened in the world of USB. Additions to the USB specifications
include many updated and expanded device-class specifications and the
USB On-The-Go supplement. Many new device-controller chips have been released.
New tools for debugging and compliance testing are available. Support
for USB device classes under Windows has improved. And Microsofts
.NET Framework has become a popular platform for developing host applications.
These developments prompted me to write USB Complete Third Edition. The material is revised and updated from start to finish to reflect these and other developments related to USB hardware and programming.
Awards and Best-seller Lists
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.
Reviews
"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
Book Info
Price: $49.95
572 pages, 7" x 9"
Publication date: August 2005
ISBN# 1-931448-02-7
Available from bookstores and on line.
Out of Print Editions
USB Complete Second Edition (ISBN 0965081958, 2001)
USB Complete (ISBN 0965081931, 1999)
Corrections
List of Corrections for the Third Edition
