logo image - link to home page

Products | Support | Resources | PurchaseContact  | Basket  | Checkout

  Home
  What's New
  Products
  Distributors
  Purchasing Info
  Developer Resources
  Support
  Upgrades
  Site Index
  Contact Us
  Pb-Free Info (RoHS)
 

 

keyword search:
 


 

Products:
  Books:
    The LAB-X1 Tutorial and Resource Book
    PICBASIC PROJECTS - 30 Projects Using PICBASIC and PICBASIC PRO
    Programming PIC Microcontrollers With PICBASIC
    Running Small Motors with PIC™ Microcontrollers
    Making PIC™ based Laboratory Instruments and Controllers
    Serial Port Complete Second Edition
    USB Complete Third Edition
    USB Mass Storage
    Build Your Own Humanoid Robots
    PIC Robotics
    Insectronics : Build Your Own Walking Robot
    Amphibionics : Build Your Own Biologically Inspired Reptilian Robot
    Designing Embedded Systems with PIC Microcontrollers: Principles and Applications
    Easy Microcontrol'n - A Beginner's Guide to Using PIC16/17 Microcontrollers
    Easy Step'n - An Introduction to Stepper Motors for the Experimenter
    PIC Microcontroller Project Book
    Microcontrol'n Apps - PIC Microcontroller Applications Guide
    Time'n and Count'n using PIC® Microcontrollers
    Programming and Customizing PICmicro Microcontrollers
    Serial Communications
     

USB Complete Third Edition - $49.95

Purchase at mcumart.com

by Jan Axelson

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.

572 pages.


Table of Contents

Introduction

1. USB Basics 1

     What USB Can Do

           Benefits for Users

           Benefits for Developers

           Beyond the Hype

     Evolution of an Interface

           Original USB

           USB 2.0

           USB On-The-Go

           Wireless USB

           USB versus IEEE-1394

           USB versus Ethernet

     Bus Components

           Topology

           Defining Terms

     Division of Labor

           The Host’s Duties

           The Peripheral’s Duties

           What about Speed?

     Developing a Device

           Elements in the Link

           Tools for Developing

           Steps in Developing a Project

2. Inside USB Transfers 33

     Transfer Basics

          Enumeration Communications

          Application Communications

          Managing Data on the Bus

          Host Speed and Bus Speed

     Elements of a Transfer

          Device Endpoints: the Source and Sink of Data

          Pipes: Connecting Endpoints to the Host

          Types of Transfers

          Stream and Message Pipes

          Initiating a Transfer

          Transactions: the Building Blocks of a Transfer

          Transaction Phases

     Ensuring that Transfers Are Successful

          Handshaking

          Reporting the Status of Control Transfers

          Error Checking

3. A Transfer Type for Every Purpose 61

     Control Transfers

          Availability

          Structure

          Data Size

          Speed

          Detecting and Handling Errors

     Bulk Transfers

          Availability

          Structure

          Data Size

          Speed

          Detecting and Handling Errors

     Interrupt Transfers

          Availability

          Structure

          Data Size

          Speed

          Detecting and Handling Errors

     Isochronous Transfers

          Availability

          Structure

          Data Size

          Speed

          Detecting and Handling Errors

     More about Time-critical Transfers

          Bus Bandwidth

          Device Capabilities

          Host Capabilities

          Host Latencies

4. Enumeration: How the Host Learns about Devices 85

     The Process

          Enumeration Steps

          Enumerating a Hub

          Device Removal

          Tips for Successful Enumeration

     Descriptors

          Types of Descriptors

          Device Descriptor

          Device_qualifier Descriptor

          Configuration Descriptor

          Other_speed_configuration Descriptor

          Interface Association Descriptor

          Interface Descriptor

          Endpoint Descriptor

          String Descriptor

          Other Standard Descriptors

          The Microsoft OS Descriptor

     Descriptors in 2.0-compliant Devices

          Making 1.x Descriptors 2.0-compliant

          Detecting the Speed of a Dual-Speed Device

5. Control Transfers: Structured Requests for Critical Data 117

     Elements of a Control Transfer

          Setup Stage

          Data Stage

          Status Stage

          Handling Errors

          Device Firmware

     The Requests

          Get_Status

          Clear_Feature

          Set_Feature

          Set_Address

          Get_Descriptor

          Set_Descriptor

          Get_Configuration

          Set_Configuration

          Get_Interface

          Set_Interface

          Synch_Frame

     Other Control Requests

          Class-specific Requests

          Vendor-specific Requests

6. Chip Choices 141

     Components of a USB Device

          The USB Controller

          Other Device Components

          Simplifying Device Development

          Device Requirements

          Chip Documentation

          Driver Choices

          Debugging Tools

     Controllers with Embedded CPUs

          Microchip PIC18F4550

          Cypress EZ-USB

          Cypress enCoRe II

          Freescale MC68HC908JB16

          Freescale MCF5482 ColdFire

     Controllers that Interface to External CPUs

          National Semiconductor USBN9603

          Philips Semiconductors ISP1181B

          Philips Semiconductors ISP1581

          PLX Technology NET2272

          FTDI Chip FT232BM and FT245BM

7. Device Classes 177

     About Classes

          Device Working Groups

          Elements of a Class Specification

     Defined Classes

          Audio

          Chip/Smart Card Interface

          Communication Devices: Modems and Networks

          Content Security

          Device Firmware Upgrade

          Human Interface

          IrDA Bridge

          Mass Storage

          Printers

          Still Image Capture: Cameras and Scanners

          Test and Measurement

          Video

     Implementing Non-standard Functions

          Standard or Custom Driver?

          Converting from RS-232

          Converting from the Parallel Port

          PC-to-PC Communications

          Using a Generic Driver

8. How the Host Communicates 233

     Device Driver Basics

          Insulating Applications from the Details

          Options for USB Devices

          User and Kernel Modes

     WDM Drivers

          Layered Drivers

          Communication Flow

          More Examples

     Creating a Custom Driver

          Writing a Driver from Scratch

          Using a Driver Toolkit

     Using GUIDs

          Device Setup GUIDs

          Device Interface GUIDs

9. Matching a Driver to a Device 253

     Using the Device Manager

          Viewing Devices

          Property Pages

     Device Information in the Registry

          The Hardware Key

          The Class Key

          The Driver Key

          The Service Key

     Inside INF Files

          Syntax

          Sections

     Using Device Identification Strings

          Finding a Match

          Do You Need to Provide an INF File?

     Tools and Diagnostic Aids

          Tips for Using INF Files

          What the User Sees

10. Detecting Devices 281

     A Brief Guide to Calling API Functions

          Managed and Unmanaged Code

          Documentation

          Using Visual C++ .NET

          Using Visual Basic .NET

     Finding Your Device

          Obtaining the Device Interface GUID

          Requesting a Pointer to a Device Information Set

          Identifying a Device Interface

          Requesting a Structure Containing the Device Path Name

          Extracting the Device Path Name

          Closing Communications

     Obtaining a Handle

          Requesting a Communications Handle

          Closing the Handle

     Detecting Attachment and Removal

          About Device Notifications

          Registering for Device Notifications

          Capturing Device Change Messages

          Reading Device Change Messages

          Retrieving the Device Path Name in the Message

          Stopping Device Notifications

11. Human Interface Devices: Using Control and Interrupt Transfers 319

     What is a HID?

          Hardware Requirements

          Firmware Requirements

     Identifying a Device as a HID

          The HID Interface

          HID Class Descriptor

          Report Descriptors

     HID-specific Requests

          Get_Report

          Get_Idle

          Get_Protocol

          Set_Report

          Set_Idle

          Set_Protocol

     Transferring Data

          About the Example Code

          Sending Reports via Interrupt Transfers

          Receiving Reports via Interrupt Transfers

          Sending Reports via Control Transfers

          Receiving Reports via Control Transfers

12. Human Interface Devices: Reports 351

     Report Structure

          Using the HID Descriptor Tool

          Control and Data Item Values

          Item Types

     The Main Item Type

          Input, Output, and Feature Items

          Collection and End Collection Items

     The Global Item Type

          Identifying the Report

          Describing the Data’s Use

          Converting Units

          Converting Raw Data

          Describing the Data’s Size and Format

          Saving and Restoring Global Items

     The Local Item Type

          Physical Descriptors

          Padding

13. Human Interface Devices: Host Application 375

     HID API Functions

          Requesting Information about the HID

          Sending and Receiving Reports

          Providing and Using Report Data

          Managing HID Communications

     Identifying a Device

          Reading the Vendor and Product IDs

          Getting a Pointer to a Buffer with Device Capabilities

          Getting the Device’s Capabilities

          Getting the Capabilities of the Buttons and Values

     Sending and Receiving Reports

          Sending an Output Report to the Device

          Reading an Input Report from the Device

          Writing a Feature Report to the Device

          Reading a Feature Report from a Device

          Closing Communications

14. Bulk Transfers for Any CPU 407

     Two Projects

          Asynchronous Serial Interface

          Parallel Interface

     Host Programming

          Using the D2XX Direct Driver

          Selecting a Driver

     Performance Tips

          Speed Considerations

          Minimizing Latency

          Preventing Lost Data

     EEPROM Programming

          EEPROM Data

          Editing the Data

15. Hubs: the Link between Devices and the Host 433

     Hub Basics

          The Hub Repeater

          The Transaction Translator

          The Hub Controller

          Speed

          Maintaing an Idle Bus

          How Many Hubs in Series?

     The Hub Class

          Hub Descriptors

          Hub-class Requests

          Port Indicators

16. Managing Power 455

     Powering Options

          Voltages

          Which Peripherals Can Use Bus Power?

          Power Needs

          Informing the Host

     Hub Power

          Power Sources

          Over-current Protection

          Power Switching

     Saving Power

          Global and Selective Suspends

          Current Limits for Suspended Devices

          Resuming Communications

          Power Management under Windows

17. Testing and Debugging 471

     Tools

          Hardware Protocol Analyzers

          Software Protocol Analyzers

          Traffic Generators

     Testing

          Compliance Testing

          WHQL Testing

18. Signals and Encoding 489

     Bus States

          Low-speed and Full-speed Bus States

          High-speed Bus States

     Data Encoding

          Staying Synchronized

          Timing Accuracy

     Packet Format

          Fields

          Inter-packet Delay

     Test Modes

          Entering and Exiting Test Modes

          The Modes

19. The Electrical Interface 505

     Transceivers and Signals

          Cable Segments

          Low- and Full-speed Transceivers

          High-speed Transceivers

     Signal Voltages

          Low and Full Speeds

          High Speed

     Cables

          Conductors

          Connectors

          Detachable and Captive Cables

          Cable Length

     Ensuring Signal Quality

          Sources of Noise

          Balanced Lines

          Twisted Pairs

          Shielding

          Edge Rates

          Isolated Interfaces

     Wireless Links

          Cypress WirelessUSB

          The Wireless USB Initiative

          Other Options

20. Dual-role Devices with USB On-The-Go 535

    Device and Host in One

          Capabilities and Limits

          Requirements for an OTG Device

          The OTG Descriptor

          Feature Codes for HNP

     OTG Controller Chips

          Philips ISP1362

          TransDimension TD242LP

          Cypress CY7C67200 EZ-OTG

          Philips ISP1261 Bridge Controller

Index

 

® Microcontrollers


Copyright 2008
microEngineering Labs, Inc.
Box 60039
Colorado Springs CO 80960
(719) 520-5323
(719) 520-1867 fax
email: support@melabs.com

Last Updated: 08/04/2008

Home | What's New | Products | Support
Resources
| Purchase | Index Contact

PIC, PICmicro, dsPIC, and  MPLAB are registered trademarks of Microchip Technology Inc. in the USA and other countries.  PICBASIC, PICBASIC PRO, PICPROTO, and EPIC are trademarks of Microchip Technology Inc. in the USA and other countries.   BASIC Stamp is a trademark of Parallax, Inc.

Microchip third-party partner  Microchip Consultant Program Member