Axelson - USB Mass Storage - Designing and Programming Devices and Embedded Hosts (Lakeview, 2006).pdf

(3286 KB) Pobierz
1931448043.pdf
426113390.001.png
USB Mass Storage
Designing and Programming
Devices and Embedded Hosts
Jan Axelson
Lakeview Research LLC
Madison, WI
USB Mass Storage: Designing and Programming Devices and Embedded Hosts
by Jan Axelson
Copyright 2006 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 for direct, indirect, special, incidental, or consequential damages in connection
with, or arising out of, the construction, performance, or other use of the materials con-
tained herein.
Many of the products and company names mentioned herein are the trademarks of their
respective holders. MPLAB, PICDEM, PICmicro, and PICtail are registered trademarks of
Microchip Technology Inc. in the U.S.A. and other countries.
Certain materials contained herein are reprinted with the permission of Microchip Technol-
ogy Incorporated. No further reprints or reproductions may be made of said materials with-
out Microchip Technology Inc.’s prior written consent.
Published by Lakeview Research LLC, 5310 Chinook Ln., Madison WI 53704
On the web at www.Lvr.com
Distributed by Independent Publishers Group ( www.ipgbook.com ).
14 13 12 11 10 9 8 7 6 5 4 3 2 1
Printed and bound in the United States of America
ISBN13 978-1-931448-05-5
ISBN10 1-931448-05-1
Contents
Acknowledgements xi
Introduction xiii
1 Mass Storage Basics 1
When to Use a Storage Device 1
Benefits 2
Other Considerations 3
Requirements 4
Devices 4
Embedded Hosts 5
Selecting a Media Type 7
Drive Mechanisms 8
Addressing Methods 10
Reading and Writing Considerations 10
Removable Media and Devices 12
Hardware Interfaces 12
Hard Drives 13
Technology 13
Interfaces 13
Flash Memory 13
Technology 14
Options for Flash Memory 15
MultiMediaCard 16
SD Memory Card 20
CompactFlash 22
iii
Contents
2 Supporting USB 25
The Interface in Brief 26
Hosts and Devices 26
Host Responsibilities 27
Device Responsibilities 29
Bus Speeds 31
Endpoints 31
Transfer Types 32
Transactions 32
The Data Toggle 33
Descriptors 34
Mass Storage Requirements 34
Choosing a Device Controller 37
Controllers with Support for Flash Memory 37
Controllers with support for ATA/ATAPI 38
Firmware Options 38
Microchip PIC18F4550 39
Architecture 39
Firmware Support 39
The USB Controller 39
3 The USB Mass Storage Class 45
Requirements 45
Specifications 45
Logical Block Addressing 46
Mass Storage Requests 46
Descriptors 46
Device Descriptor 47
Configuration Descriptor 49
Interface Descriptor 51
Endpoint Descriptors 53
String Descriptors 54
iv
Zgłoś jeśli naruszono regulamin