Lakeview Research home > USB Complete > From the Introduction

From the Introduction

to USB Complete, Third Edition

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 you’re 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.

What’s Inside

These are some of questions the book answers:

How do USB devices communicate? The USB interface can seem daunting at first. The USB 2.0 specification is over 600 pages, not counting the class specifications and other supplementary documents. This book doesn’t attempt to restate everything in the specifications. Instead, the focus is on what you’ll need to know to enable your devices to communicate efficiently and reliably.

How can I decide if my device should use a USB interface? USB isn’t the best choice for every application. Find out whether your design should use USB or another interface. The chances are good that you will choose USB, however, and if so, you’ll learn how to decide which of USB’s three speeds and four transfer types are appropriate for your application.

What controller chip should my device use? Every USB device must contain an intelligent controller to implement the USB interface. Dozens of manufacturers offer controller chips with differing architectures and abilities. This book includes descriptions of popular chips and tips to help you select a controller based on your project’s needs and your background and preferences.

How do applications communicate with USB devices? PC applications access a USB device by communicating with the device driver the operating system has assigned to the device. Some devices can use class drivers that are included with Windows. Others devices require custom drivers. This book will introduce you to the classes and will help you determine if a defined class is appropriate for your device. If your device requires a custom driver, you’ll learn what’s involved in writing a driver, what tools can help speed up the process, and options for obtaining drivers from other sources. Example code shows how to detect and communicate with devices in Visual Basic .NET and Visual C++ .NET applications.

What firmware does my device need to support USB communications? Learn how to write device firmware that enables your device to respond to received requests and exchange other data on the bus.

How do I decide whether my device can use bus power or needs its own supply? Many USB devices can be powered entirely from the bus. Find out whether your device can use bus power. Learn how to ensure that your device meets USB’s requirement to limit the use of bus current when the host computer suspends the bus.

Can I connect other USB peripherals to my device? Find out how to use USB On-The-Go to enable your device to act as a limited-capability host that can access other USB peripherals.

How can I ensure that my device will communicate without problems? At the device, writing bugfree firmware requires understanding what your device must do to meet the requirements of the USB specifications. At the host computer, Windows must have the information needed to identify the device and locate a driver to communicate with the device. This book has tips, example code, and information about debugging software and hardware to help with these tasks.

To understand the material in the book, it’s helpful to have basic knowledge in a few areas. I assume you have some experience with digital logic, application programming for PCs and writing embedded code for peripherals. You don’t have to know anything at all about USB.