Embedding USB Lane Hauck Cypress Semiconductor. Embedded Systems Conference, March 2002 Embedding USB 1 Agenda  Why USB?  USB Advantages  USB Basics.

Slides:



Advertisements
Similar presentations
Primary Author: Girish Verma Secondary Author(s): Navya Prabhakar Presenter: Navya Prabhakar Company/Organization: CircuitSutra USB Modeling Quick Start.
Advertisements

So, you think you need USB On-The-Go?. Agenda Introduction Embedded Host terminology OTG – Electrical – Protocol When to use OTG 2.
Protocol Layer Bottom-up view of the USB protocol Bottom-up view of the USB protocol –Byte/Bit Ordering –SYNC Field –Packet Field Formats PID Field PID.
Universal Serial Bus Grant Heileman. The History of USB In 1994 a collaborative effort to design a standard for peripheral devices was made between Compaq,
USB: Data Flow Sukesh Shenoy. USB implementation areas.
I/O Channels I/O devices getting more sophisticated e.g. 3D graphics cards CPU instructs I/O controller to do transfer I/O controller does entire transfer.
1 USB 2.0 Specification  General Description  From where we could begin the work  What would be valid to do?  Main doubts  What is OTG (On the Go)
1 USB 2.0 Specification  General Description  What is OTG (On the Go)  From where we could begin the work  What would be valid to do?
USB – An Overview Group 3 Kaushik Nandha Bikram What is the Universal Serial bus (USB)? Is a cable bus that supports data exchange between a host computer.
Anush Rengarajan Feng Zheng Thomas Madaelil
USB 2.0 INTRODUCTION NTUT CSIE 學 生:許家豪 指導教授:柯開維教授.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 15 PC Standard Bus Interfaces WK.
Introduction to USB. 2 Agenda Introduction to USB LPC23xx Block diagram MCB2300 demo.
EE 446 Embedded Architecture. Universal Serial Bus A representative peripheral interface Universal Serial Bus (USB) provides a serial bus standard for.
USB: UNIVERSAL SERIAL BUS Joe Kaewbaidhoon Alex Motalleb Vishal Joshi Prepared for EECS 373 University of Michigan, Ann Arbor 1.
Choosing (and Implementing) the Correct USB Connectivity for Your Embedded System Steve Wetterling, MSEE = Pat Barrett,
18 - Winter 2003 EE EE 766 Computer Interfacing and Protocols 1 USB (Universal Serial Bus) Need for “Plug and Play” capability for PC peripherals outside.
USB Fundamentals and Applications for Digital Signal Processing
USB Josh Rickmar John Marcoux. Topics Purpose and Goals History Bus Design Power Differential Signaling Connectors Changes in USB 3.0.
Mentor.com/embedded Colin Walls USB 3.0: An Introduction for Embedded Software Developers.
8/17/20151 WIRELESS U.S.B.. 8/17/20152 CONTENTS INTRODUCTION WIRELESS COMMUNICATION WIRED USB WIRELESS USB FEATURES WUSB TOPOLOGY PEROFRMANCE PRACTICAL.
Copyright © 2007 Heathkit Company, Inc. All Rights Reserved PC Fundamentals Presentation 41 – Input/Output Ports.
Peripheral Buses COMP Jamie Curtis. PC Buses ISA is the first generation bus 8 bit on IBM XT 16 bit on 286 or above (16MB/s) Extended through.
May 8, The EASY Way to Create I/O Devices John Hyde Intel Corporation intel.com.
Spring 2014 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
May 9, USB 2.0 High Bandwidth Peripheral Design Challenges Robert Shaw Cypress Semiconductor Robert Shaw Cypress Semiconductor
October 10, USB 2.0 Hub Testing Dan Froelich Intel.
Embedded Systems Architecture Class Project USB 2.0 Function Controller December 12, 2008 Brandon Wolfe, Ben Marrou, Daniel Chan.
Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output.
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
Peripheral Busses COMP Jamie Curtis. PC Busses ISA is the first generation bus 8 bit on IBM XT 16 bit on 286 or above (16MB/s) Extended through.
October 10, USB OnTheGo Ed Beeman Hewlett Packard.
Introduction to USB Development. USB Development Introduction Technical Overview USB in Embedded Systems Recent Developments Extensions to USB USB as.
Introduction to USB © 2010 Renesas Electronics America Inc. All rights reserved.
USB host for web camera connection
Using the PSoC USB March 17, 2012 Lloyd Moore, President/Owner.
USB Link Layer Protocol
HyperTransport™ Technology I/O Link Presentation by Mike Jonas.
ECE 371 – UNIT 20 Universal Serial Bus (USB). References 1. Universal Serial Bus Specification, Revision 2.0. This specification is available on the World.
Mr C Johnston ICT Teacher BTEC IT Unit 02 - Lesson 03 Inside Computers #2 – Drives, Connectors and Internal Memory.
Universal Serial Bus - USB Historical Perspective The Universal Serial Bus was originally developed in 1995 by a group of industry.
Microprocessor-based Systems
Basic LAN techniques IN common with all other computer based systems networks require both HARDWARE and SOFTWARE to function. Networks are often explained.
Chapter 6 – Connectivity Devices
Computer Maintenance Copyright © Texas Education Agency, All rights reserved. 1 FireWire Ports.
May 9, USB On-The-Go Implementation Trade-offs Zong Liang WU TransDimension Zong Liang WU TransDimension.
May 16, USB 2.0 Technical Overview Brad Hosler USB Engineering Manager Intel Corporation.
Input/Output Computer component : Input/Output I/O Modules External Devices I/O Modules Function and Structure I/O Operation Techniques I/O Channels and.
October 10, USB 2.0 Technical Overview Brad Hosler USB Engineering Manager Intel Corporation.
Data Communications (E&T2760): USB and IEEE USB and IEEE 1394.
1 Presented By: Eyal Enav and Tal Rath Eyal Enav and Tal Rath Supervisor: Mike Sumszyk Mike Sumszyk.
Computer Maintenance UNT in partnership with TEA, Copyright ©. All rights reserved1 FireWire Ports.
©F.M. Rietti Communication Lines Fundamentals. ©F.M. Rietti LM-18 Computer Science SSI Embedded Systems I 2 Communication Lines Generally used to connect.
PCs ENVIRONMENT and PERIPHERALS Lecture 1. Software The series of instructions that tells the hardware how to perform tasks Software The series of instructions.
SEPTEMBER 8, 2015 Computer Hardware 1-1. HARDWARE TERMS CPU — Central Processing Unit RAM — Random-Access Memory  “random-access” means the CPU can read.
USB Universal Serial Bus. University of Tehran 2.
Embedding USB technology Limitations, challenges and compliance
USB The topics covered, in order, are USB background
USB PHYISICAL LAYER PROTOCOL ENGINE LAYER APPLICATION LAYER
HyperTransport™ Technology I/O Link
Operating Systems (CS 340 D)
USB Universal Serial Bus
Universal Serial Bus Specification 1.0
USB- Universal Serial Bus
USB : Universal Serial Bus
Greg Bell Business Development Mgr Industrial & Security Markets
Universal Serial Bus (USB)
Presentation transcript:

Embedding USB Lane Hauck Cypress Semiconductor

Embedded Systems Conference, March 2002 Embedding USB 1 Agenda  Why USB?  USB Advantages  USB Basics With embedded system emphasis  An Implementation Roadmap  USB On The Go  An Embedded Host Example  Conclusion

Embedded Systems Conference, March 2002 Embedding USB 2 Agenda  Why USB?  USB Advantages  USB Basics With embedded system emphasis  An Implementation Roadmap  USB On The Go  An Embedded Host Example  Conclusion

Embedded Systems Conference, March 2002 Embedding USB 3 Why USB?  No other way to talk to so many things Input devices –Mice, keyboards, joysticks Memory devices –Disk drives –Memory cards Fingerprint scanners  It’s standard USB Implementers Forum, Inc. Plugfests

Embedded Systems Conference, March 2002 Embedding USB 4 Agenda  Why USB?  USB Advantages  USB Basics With embedded system emphasis  An Implementation Roadmap  USB On The Go  An Embedded Host Example  Conclusion

Embedded Systems Conference, March 2002 Embedding USB 5 USB Advantages  Many standardized, low cost devices are available  Connectors and cables are standard  USB devices are compliance-tested to insure compatibility and uniform performance  Using hubs, multiple USB devices can share one connector  USB devices can tell you about their capabilities

Embedded Systems Conference, March 2002 Embedding USB 6 USB Advantages (Cont’d)  USB provides device power  USB devices can: Be put to sleep Be awakened Provide a system wakeup call  USB protocol takes care of low-level details Flow control Error checking  You decide how complex to make the firmware

Embedded Systems Conference, March 2002 Embedding USB 7 Agenda  Why USB?  USB Advantages  USB Basics With embedded system emphasis  An Implementation Roadmap  USB On The Go  An Embedded Host Example  Conclusion

Embedded Systems Conference, March 2002 Embedding USB 8 USB Basics with embedded system emphasis  Speeds  Cables  Topology  Endpoints  Transfer Types  Handshakes

Embedded Systems Conference, March 2002 Embedding USB 9 USB Basics cont’d  Hubs  Power Management  Device Classes  Host Chips & Drivers  Protocol

Embedded Systems Conference, March 2002 Embedding USB 10 Speeds  USB 1.0 and 1.1 Low speed is 1.5 Mbits/sec –Packet size is limited to 8 bytes –Transfer type limited –Don’t want to wait slowly Full speed is 12 Mbits/sec  USB 2.0 “Hi-speed” is 480 Mbits/sec  USB 1.x retro-named “Classic” USB  12 Mb/s is great for embedded systems

Embedded Systems Conference, March 2002 Embedding USB 11 Cables  Shielded 4-wire cables Vbus = volts GND D+ and D-  Reflected-wave signaling Low power buffers  5 meter limit Hubs extend effective cable length  Cables are standard, plentiful and cheap

Embedded Systems Conference, March 2002 Embedding USB 12 Cables 1 foot cable Driver Receiver

Embedded Systems Conference, March 2002 Embedding USB 13 Cables 2 meter cable Driver Receiver

Embedded Systems Conference, March 2002 Embedding USB 14 Cables 5 meter cable Driver Receiver

Embedded Systems Conference, March 2002 Embedding USB 15 Topology tiered star  One USB connector can support up to 127 devices

Embedded Systems Conference, March 2002 Embedding USB 16 Endpoints  Endpoints are logical channels inside a peripheral device  In hardware they’re addressable buffers (FIFOS) Every host transfer includes a 4-bit endpoint number and a direction bit  CONTROL endpoint 0 is mandatory  All others are up to the design  Endpoints are handy for separating data types

Embedded Systems Conference, March 2002 Embedding USB 17 Transfer Types four types to suit data requirements  Control Mission-critical, highest error protection Used to interrogate, configure and control devices  Bulk  Interrupt  Isochronous  BULK is easiest to use and the most flexible

Embedded Systems Conference, March 2002 Embedding USB 18 Transfer Types anatomy of a USB frame 12MHz = 1.5MB/s or 1500 bytes/ms (full speed) Isochronous/Interrupt traffic have guaranteed bandwidth Control traffic is “best-effort” Bulk uses what is left Video Audio MouseControl Printer 1 msec frame SOF... IsochronousInterruptControlBulk SOF

Embedded Systems Conference, March 2002 Embedding USB 19 Handshakes  ACK means “success”  NAK means “try again”  No response means error  Handshakes used for CONTROL BULK INTERRUPT  You don’t need to implement flow control

Embedded Systems Conference, March 2002 Embedding USB 20 Handshakes a CONTROL Transfer I N A D D R E N D P C R C 5 Token Packet D A T A 1 Payload Data C R C 1 6 Data Packet A C K H/S Pkt HP H DATA HHPHHP D A T A 1 O U T A D D R E N D P C R C 5 Token Packet C R C 1 6 Data Pkt N A K H/S Pkt D A T A 1 O U T A D D R E N D P C R C 5 Token Packet C R C 1 6 Data Pkt A C K H/S Pkt (Operation not completed)(Operation completed) HANDSHAKE D A T A 0 8 bytes Setup Data C R C 1 6 Data Packet A C K H/S Pkt S E T U P A D D R E N D P C R C 5 Token Packet HHP SETUP H is Host P is Peripheral

Embedded Systems Conference, March 2002 Embedding USB 21 Hubs PC USB Device Hub USB PC USB Device

Embedded Systems Conference, March 2002 Embedding USB 22 Hubs power Hub USB PC USB Device

Embedded Systems Conference, March 2002 Embedding USB 23 Hubs more power Hub USB PC USB Device 500 Wall Wart 500

Embedded Systems Conference, March 2002 Embedding USB 24 Hubs more devices Hub USB PC USB Device 500 Wall Wart 500 USB Device 500  Easy way to expand and power devices

Embedded Systems Conference, March 2002 Embedding USB 25 Power Management  USB power consumption is carefully controlled  Host determines power needs of all attached devices Only configures those within power limits  USB devices must enter low power mode when host signals ‘suspend’ 500 microamps  USB devices can signal a remote wakeup  Built-in mechanism prevents peripherals from drawing too much power from your system

Embedded Systems Conference, March 2002 Embedding USB 26 Device Classes  USB-sanctioned method to extend the specification to device classes  Classes are devices with similar characteristics  Huge advantage—the driver is built into the OS Not written and maintained by YOU  Immense simplification of the software effort if the OS supports your device

Embedded Systems Conference, March 2002 Embedding USB 27 Protocol  USB architects went well beyond the electrical interface Remember IrDa?  Protocol layer insures interoperability  Compliance testing (plugfests) enforce the protocol  USB protocol is extensible Device classes Fully custom ‘vendor’ designs  Device standardization makes the embedded software task far easier than writing custom drivers

Embedded Systems Conference, March 2002 Embedding USB 28 Protocol  A large part of the embedded system design is understanding the protocol  How much do you need to support? How many devices How many device types How many hub layers  Embedded USB is by necessity a subset of full PC-based USB  Efforts are underway to simplify the software task (more about this)

Embedded Systems Conference, March 2002 Embedding USB 29 Protocol the eight bytes in a SETUP packet ByteFieldMeaning 0bmRequestTypeRequest type 1bRequestThe actual request 2wValueLVaries by request 3wValueH 4wIndexLVaries by request 5wIndexH 6wLengthLNumber of data bytes 7wLengthH

Embedded Systems Conference, March 2002 Embedding USB 30 Protocol Chapter 9 Requests Standard Class Vendor bRequest Custom Programming 00 GET_STATUS 0C STALL CLR_FEATURE SET_FEATURE SET_ADDRESS GET_DESCRIPT0R SET_DESCRIPT0R GET_C0NFIG SET_CONFIG GET_INTERFACE SET_INTERFACE SYNC_FRAME A 0B STALL other X01XXXXXX00XXXXXX11XXXXXX10XXXXX 03 DEVICE CONFIGURATION STRING STALL other wValueH bmRequestType

Embedded Systems Conference, March 2002 Embedding USB 31 Protocol added HID Class Requests Standard Class Vendor bRequest Custom Programming 00 GET_STATUS 0C STALL CLR_FEATURE SET_FEATURE SET_ADDRESS GET_DESCRIPT0R SET_DESCRIPT0R GET_C0NFIG SET_CONFIG GET_INTERFACE SET_INTERFACE SYNC_FRAME A 0B STALL other bRequest X01XXXXXX00XXXXXX11XXXXXX10XXXXX 03 DEVICE CONFIGURATION STRING STALL other wValueH 0B GET_REPORT GET_IDLE GET_PROTOCOL SET_REPORT SET_IDLE SET_PROTOCOL A STALL other 23 HID REPORT PHYSICAL bmRequestType

Embedded Systems Conference, March 2002 Embedding USB 32 Host Chips & Drivers  PC’s use OCHI/UHCI host controllers Usually part of a ‘Southbridge’ chip Driver software is part of the OS –Class drivers –USBD.sys –HAL: OHCI.sys or UHCI.sys  Embedded systems use different, proprietary host controllers Hardware abstraction layer is custom

Embedded Systems Conference, March 2002 Embedding USB 33 Host Chips & Drivers PCSimple Embedded

Embedded Systems Conference, March 2002 Embedding USB 34 Host Chips & Drivers PC implementation  Apps or class drivers create IO Request Packets (IRP)  USB Driver Processes IRP’s Manages CONTROL pipe Division of duties between USBD and HCD is not defined  Host Controller Driver (HCD) Provides abstraction –Of host controller registers –Of data transfer specifics HCD creates a transaction list –Schedule of transfers  Host Controller turns transaction list into packets

Embedded Systems Conference, March 2002 Embedding USB 35 Host Chips & Drivers why the PC architecture is complex  App needs no knowledge of Which host controller is installed USB signaling details Bus utilization details Transaction lists  App talks to buffers in your device using “pipes”  Most of the HCD/HC complexity is due to the flexible nature of USB 127 devices Devices appear and disappear at random Bandwidth must be fairly shared between devices

Embedded Systems Conference, March 2002 Embedding USB 36 Host Chips & Drivers simplest embedded hardware  Looks simple  The hardware is simple  But software is “low-level” Detect USB device attachment Detect speed Enumerate devices Suspend and resume devices Manage error recovery Generate USB resets Conduct transfers Simple Embedded

Embedded Systems Conference, March 2002 Embedding USB 37 Host Chips & Drivers RTOS provides a ‘middle’ solution Examples –WinCE –Linux –VxWorks Host Controller vendor may provide a small driver to make the chip look like something the RTOS supports

Embedded Systems Conference, March 2002 Embedding USB 38 Agenda  Why USB?  USB Advantages  USB Basics With embedded system emphasis  An Implementation Roadmap  USB On The Go  An Embedded Host Example  Conclusion

Embedded Systems Conference, March 2002 Embedding USB 39 An implementation roadmap  Pick a host controller  For simple interface (a few simple devices) Write custom firmware Use chip supplier tools –Compilers, debuggers –Sample code  For more general interface Use an RTOS with USB support Chip supplier usually provides hardware drivers Check the supported device class list

Embedded Systems Conference, March 2002 Embedding USB 40 Agenda  Why USB?  USB Advantages  USB Basics With embedded system emphasis  An Implementation Roadmap  USB On The Go  An Embedded Host Example  Conclusion

Embedded Systems Conference, March 2002 Embedding USB 41 USB On The Go goals  Connect two peripherals together PC is not required (but still supported)  Allow peripherals to awaken each other Session Request Protocol (SRP)  Allow devices to exchange the host role Host Negotiation Protocol (HNP)  New OTG devices can tap into the existing 900 million USB devices Forecast: 1 billion devices by 2003

Embedded Systems Conference, March 2002 Embedding USB 42 USB On The Go marketing foil

Embedded Systems Conference, March 2002 Embedding USB 43 USB On The Go hardware details  Defines a new connector and cable “Mini-AB” receptacle Mini-A to Mini-B cable Cable establishes the default host –A-Device is the default host –Host turns on VBUS  Dual-role USB devices: Sometimes a peripheral, sometimes a host Must use the new AB connector Provide limited host capability Supply 8 mA (min) on VBUS Operate at full speed (high speed optional)

Embedded Systems Conference, March 2002 Embedding USB 44 USB On The Go the best news may be on the software side  Impossible for a small battery operated device to support everything a PC does  Solution: a Targeted Device List Simplifies and standardizes device classes Example: OTG printer class  This effort is underway in the OTG Device Working Group  Moves complexity from your application code and drivers into the Operating System

Embedded Systems Conference, March 2002 Embedding USB 45 Agenda  Why USB?  USB Advantages  USB Basics With embedded system emphasis  An Implementation Roadmap  USB On The Go  An Embedded Host Example  Conclusion

Embedded Systems Conference, March 2002 Embedding USB 46 USB peripheral dev tools Full-speed USB Development Board Test USB USB PC Develop--Debug Serial

Embedded Systems Conference, March 2002 Embedding USB 47 Simple embedded host Full-speed USB Development Board Add-on board contains USB host plus 4-port hub PC USB Serial Develop--Debug Test Host Transfers

Embedded Systems Conference, March 2002 Embedding USB 48 Simple embedded host

Embedded Systems Conference, March 2002 Embedding USB 49 Simple embedded host

Embedded Systems Conference, March 2002 Embedding USB 50 Simple embedded host

Embedded Systems Conference, March 2002 Embedding USB 51 Simple embedded host Example:  BTC Keyboard + 2-port Hub with embedded Fingerprint Scanner –Addr1 = 2 port Hub –Addr2 = Fingerprint Scanner –Addr3 = Keyboard  Fuji Digital Still Camera –Addr4 = Mass Storage Class (MSC)  Mitsumi Mouse –Addr5 = HID Class –Data being read through EP1

Embedded Systems Conference, March 2002 Embedding USB 52 Simple embedded host (live example)

Embedded Systems Conference, March 2002 Embedding USB 53 Conclusion  Embedded host chips are here now  Software is the main effort  Point solution is easy  More complex solution requires an RTOS with USB support Third-party choices Some classes are supported  USB OTG aims to provide simplified and standardized host drivers