Protocolo Usb
USB Complete
Everything You Need to Develop Custom USB Peripherals Third Edition
Jan Axelson
Lakeview Research LLC Madison, WI 53704
USB Complete: Everything You Need to Develop USB Peripherals, Third Edition by Jan Axelson Copyright 1999-2005 by Janet L. Axelson All rights reserved. No part of the contents of this book, except the program code,may be reproduced or transmitted in any form or by any means without the written permission of the publisher. The program code may be stored and executed in a computer system and may be incorporated into computer programs developed by the reader. The information, computer programs, schematic diagrams, documentation, and other material in this book are provided “as is,” without warranty of any kind,expressed or implied, including without limitation any warranty concerning the accuracy, adequacy, or completeness of the material or the results obtained from using the material. Neither the publisher nor the author shall be responsible for any claims attributable to errors, omissions, or other inaccuracies in the material in this book. In no event shall the publisher or author be liable fordirect, indirect, special, incidental, or consequential damages in connection with, or arising out of, the construction, performance, or other use of the materials contained herein. Many of the products and company names mentioned herein are the trademarks of their respective holders. PICMicro is a registered trademark of Microchip Technology Inc. in the U.S.A. and other countries. Published byLakeview Research LLC, 5310 Chinook Ln., Madison WI 53704 On the web at www.Lvr.com Distributed by Independent Publishers Group (www.ipgbook.com). Cover by Rattray Design. Cover Photo by Bill Bilsley Photography. Index by Julie Kawabata. 14 13 12 11 10 9 8 7 6 5 4 3 2 1 PDF e-book edition ISBN13 978-1-931448-03-1 ISBN10 1-931448-03-5
Contents
Contents
Introduction xv 1. USB Basics 1
What USBCan Do 2
Benefits for Users 2 Benefits for Developers 6 Beyond the Hype 10
Evolution of an Interface 13
Original USB 14 USB 2.0 15 USB On-The-Go 16 Wireless USB 16 USB versus IEEE-1394 16 USB versus Ethernet 17
Bus Components 17
Topology 18 Defining Terms 19
iii
Contents Division of Labor 22
The Host’s Duties 22 The Peripheral’s Duties 25 What about Speed? 28
Developing aDevice 29
Elements in the Link 29 Tools for Developing 30 Steps in Developing a Project 30
2. Inside USB Transfers 33
Transfer Basics 34
Enumeration Communications 34 Application Communications 34 Managing Data on the Bus 35 Host Speed and Bus Speed 36
Elements of a Transfer 37
Device Endpoints: the Source and Sink of Data 38 Pipes: Connecting Endpoints to the Host 40 Types of Transfers 40Stream and Message Pipes 42 Initiating a Transfer 43 Transactions: the Building Blocks of a Transfer 44 Transaction Phases 45
Ensuring that Transfers Are Successful 51
Handshaking 51 Reporting the Status of Control Transfers 55 Error Checking 56
3. A Transfer Type for Every Purpose 61
Control Transfers 61
Availability 62 Structure 62 Data Size 66 Speed 66 Detecting and Handling Errors 68Bulk Transfers 68
Availability 69 Structure 69 Data Size 69 Speed 71 Detecting and Handling Errors 71
iv
Contents Interrupt Transfers 72
Availability 72 Structure 72 Data Size 73 Speed 73 Detecting and Handling Errors 75
Isochronous Transfers 76
Availability 76 Structure 76 Data Size 79 Speed 79 Detecting and Handling Errors 80
More about Time-critical Transfers 80
Bus Bandwidth81 Device Capabilities 81 Host Capabilities 82 Host Latencies 83
4. Enumeration: How the Host Learns about Devices 85
The Process 86
Enumeration Steps 87 Enumerating a Hub 91 Device Removal 92 Tips for Successful Enumeration 92
Descriptors 93
Types of Descriptors 94 Device Descriptor 96 Device_qualifier Descriptor 99 Configuration Descriptor 101 Other_speed_configuration Descriptor 103...
Regístrate para leer el documento completo.