USB Fundamental

Embed Size (px)

Citation preview

  • 7/30/2019 USB Fundamental

    1/32

    1Mikes

    USB

    Intel Serial Bus (Universal Serial Bus)

  • 7/30/2019 USB Fundamental

    2/32

    2Mikes

    What is USB?

    Universal Serial Bus, an external serial bus standard that

    supports data transfer rates up to 480Mbps

    Simple Interface Two wires for power

    Two wires for data

    Up to 127 devices can be connected to one System/Host

    Hubs can expand thenumber of available ports

    System Topology: Host (master) and Peripherals (slaves)

  • 7/30/2019 USB Fundamental

    3/32

    3Mikes

    Lets Start With The Obvious:Why USB?

    Set-up takes a long time and isconfusing

    Frequent PC crashes

    Cable clutter with device conflicts

    Inaccessible connectors

    Poor hot-plug support

    PC circa 1999

    The USB Solution

    Revolutionary Ease-Of-Use

    True Plug & Play

    Hot insertion and removal

    Auto-detection and configuration All external to the box

    No more IRQ, DIP switch, and configuration

    confusion

    Eliminates the need for multiple I/O standards

  • 7/30/2019 USB Fundamental

    4/324

    Mikes

    Flavors of USB

    USB 2.0 is the Latest Governing Specification(Replaces Classic USB 1.1 Spec)

    1.5

    12

    480

    0 100 200 300 400 500

    Speed (Mbps)

    Low Speed

    Full Speed

    High Speed

    > 1 Billion USB 1.1

    Devices Sold

    (Most Successful InterfaceEver!)

  • 7/30/2019 USB Fundamental

    5/32

    5Mikes

    USB 1.1 Hardware Overview

    USB HOST

    ROOT HUB

    USB HOST

    ROOT HUB

    USB

    Peripheral

    USB

    Peripheral

    USB

    Peripheral

    USBPeripheral

    USB

    Peripheral

    USBPeripheral

    USB

    Peripheral

    USB

    Peripheral

    USB

    HUB

    USB

    HUB

    USBHUB

    USBHUB

    USB

    HUB

    USB

    HUBUSB

    HUB

    USB

    HUB

    USB

    Peripheral

    USB

    PeripheralUSB

    Peripheral

    USB

    PeripheralUSB

    Peripheral

    USB

    PeripheralUSB

    Peripheral

    USB

    PeripheralUSB

    Peripheral

    USB

    PeripheralUSB

    Peripheral

    USB

    Peripheral

    USB

    Peripheral

    USB

    Peripheral

    Topology Tiered Star, one host, auto-detects

    127 Logical connection

    Bus transactions Speed: 1.5Mbps or 12Mbps

    Isochronous or Asynchronous

    Hub Repeater & Termination

    Self-Powered or bus-poweredConfiguration

    Dynamic Insertion/removal

    Autoconfiguration on change

    Physical layer 4 pin connector, 4 wire cable

    2-wire differential signaling

    +5V DC supply/Gnd

  • 7/30/2019 USB Fundamental

    6/32

    6Mikes

    USB 1.1 Signaling

    USB 1.1

    Full-speed

    12Mbps signal rate, 5 meter cablesLow - Speed

    1.5 Mbps signal rate, 3 meter cables

    Differential data linesClock recovered from data

    4 signals (VBUS, D+, D-, Ground)

  • 7/30/2019 USB Fundamental

    7/32

    7Mikes

    USB 2.0: An Evolution of USB

    Faster signaling rate 480 Mbps (40x faster than USB 1.1)

    Seamless migration for end users Fully forward and backward compatible to USB 1.1

    Works with existing cables and connectors

    Same full/low speed signaling and functionality

    Same dynamic attach/detach detection model

    Same power and power management features

    Supports multiple high-bandwidth peripherals

    running simultaneously

  • 7/30/2019 USB Fundamental

    8/32

    8Mikes

    USB 2.0 Topology

    USB 2.0 HOST

    ROOT HUB

    USB 2.0 HOST

    ROOT HUB

    USB 1.1

    Peripheral

    USB 1.1

    Peripheral

    USB 1.1

    Peripheral

    USB 1.1

    PeripheralUSB 2.0

    Peripheral

    USB 2.0

    Peripheral

    USB 2.0

    Peripheral

    USB 2.0Peripheral

    USB 2.0

    HUB

    USB 2.0

    HUB

    USB 2.0

    HUB

    USB 2.0

    HUB

    USB 1.1HUB

    USB 1.1HUB

    USB 2.0

    HUB

    USB 2.0HUB

    USB 2.0

    Peripheral

    USB 2.0

    PeripheralUSB 1.1

    Peripheral

    USB 1.1

    PeripheralUSB 2.0

    Peripheral

    USB 2.0

    PeripheralUSB 1.1

    Peripheral

    USB 1.1

    PeripheralUSB 2.0

    Peripheral

    USB 2.0

    PeripheralUSB 1.1

    Peripheral

    USB 1.1

    Peripheral

    USB 2.0

    Peripheral

    USB 2.0Peripheral

    USB 2.0 HOST

    ROOT HUB

    USB 2.0 HOST

    ROOT HUB

    USB 1.1

    Peripheral

    USB 1.1

    Peripheral

    USB 1.1

    Peripheral

    USB 1.1

    PeripheralUSB 2.0

    Peripheral

    USB 2.0

    Peripheral

    USB 2.0

    Peripheral

    USB 2.0Peripheral

    USB 2.0

    HUB

    USB 2.0

    HUB

    USB 2.0

    HUB

    USB 2.0

    HUB

    USB 1.1HUB

    USB 1.1HUB

    USB 2.0

    HUB

    USB 2.0HUB

    USB 2.0

    Peripheral

    USB 2.0

    PeripheralUSB 1.1

    Peripheral

    USB 1.1

    PeripheralUSB 2.0

    Peripheral

    USB 2.0

    PeripheralUSB 1.1

    Peripheral

    USB 1.1

    PeripheralUSB 2.0

    Peripheral

    USB 2.0

    PeripheralUSB 1.1

    Peripheral

    USB 1.1

    Peripheral

    USB 2.0

    Peripheral

    USB 2.0Peripheral

    Tier 1

    Tier 2

    Tier 3

    Tier 4

    Tier 5

    USB 1.1 Traffic

    USB 2.0 Traffic

    USB 1.1 and USB 2.0

    peripherals and hosts

    WILL WORK TOGETHER

  • 7/30/2019 USB Fundamental

    9/32

    9Mikes

    Traditional USB Topology

    One PC host per system

    Host initiates all data transfers

    Devices do not speak unless spoken toHubs connect multiple devices

    Repeaters and Terminations

    4 ports and 7 ports are popular

    Power (self powered and bus)

    Device and Endpoints

    A device is a collection of endpoints

    FullSpeed

    Full

    Spee

    d

    LowSpeed

    Hub

    Full

    Spe

    ed

    Full Size USB Connectors

  • 7/30/2019 USB Fundamental

    10/32

    10Mikes

    Full Size USB Connectors

    Connectors 4-position with shielded housing

    Positive retention

    Blind Mating Capabilities 2 types

    Input to USB Device or HUB

    Output from USB Host or HUB

  • 7/30/2019 USB Fundamental

    11/32

    11Mikes

    Mechanical Environment

    HOSTHub

    Device

    Device

    Series B - Plug

    Series A - Plug

    Series B - ReceptacleSeries A - Receptacle

    Shielded cable - Maximum 5 meter

    Unshielded cable - Maximum 3 meter

    USB C bl

  • 7/30/2019 USB Fundamental

    12/32

    12Mikes

    USB Cable

    Cables

    28 AWG twisted pair for signaling

    30-20 AWG pair for power- (IR drop limits length)

    Shielding for fully rated segments

    Full speed cable requires shield

    Low speed cable does not requireshield

    Full speed cable can be used with

    low speed applications

    Full speed cable is required to haveB connector

    Vbus = 5Vdc

    GND

    Differntial

    Signal Pai

    Screen

    Si l T i ti f LS

  • 7/30/2019 USB Fundamental

    13/32

    13Mikes

    Signal Termination for LSDevice

    D-

    D+

    15KHost

    or

    Hub port

    FS/LS USB

    Transceiver

    Untwisted pair, unshielded, 3 meters Max

    D-

    D+

    Low speed function

    1.5K

    FS/LS USB

    Transceiver

    3.0~3.6V

  • 7/30/2019 USB Fundamental

    14/32

    14Mikes

    Signal Termination for FSDevice

    Twisted pair, shielded, 5 meters Max, Z0=90 15%

    D-

    D+

    15KHost

    or

    Hub port

    FS/LS USB

    Transceiver

    D-

    D+

    Hub port 0

    or

    Full speed function

    1.5K

    FS/LS USB

    Transceiver

    3.0~3.6V

    Hi h S d Si li

  • 7/30/2019 USB Fundamental

    15/32

    15Mikes

    High Speed SignalingChirp and Speed Detection

    Device starts by attaching as Full Speed

    Device then issues a Chirp K

    Host response is Chirp JK sequence

    Device applies High Speed termination

    Idle Chirp K

    ChirpJK

    D+

    D-

    USB D t T f T

  • 7/30/2019 USB Fundamental

    16/32

    16Mikes

    USB Data Transfer Types

    Each transfer type and protocol is best suited for particularuses.

    USB Data Transfer

    Types

    Typical Applications

    Control All Devices

    Interrupt Mouse. Keyboard,Joysticks, Gaming, HID

    Bulk Scanner, Printer, DSC,Modems, Networking

    Isochronous Video Cameras, Audio

    I h d t t f

  • 7/30/2019 USB Fundamental

    17/32

    17Mikes

    Isochronous data transfer

    For real time application w. constant data

    transfer i.e. video, audio

    The need to provide data on a timely basis ismore important than verifying accurate

    delivery

    No error handling and correction In and Out pipes may be configured

    Max 90% of bandwidth for each frame

    Max FIFO length 1023 Bytes

    Available at FS, HS

    B lk data transfer

  • 7/30/2019 USB Fundamental

    18/32

    18Mikes

    Bulk data transfer

    For transmission of large not time critical data

    blocks, i.e. Printer, scanner, disk

    Access to USB bus only if there is availablebandwidth

    In and Out pipes may be configured

    Max FIFO 64 BytesError detection and recovery

    Available at FS, HS

    Endpoints and Pipes

  • 7/30/2019 USB Fundamental

    19/32

    19Mikes

    Endpoints and Pipes

    Endpoint Software communicates with USB device via

    endpoints

    Uniquely identifiable: endpoint ID

    Endpoint 0: required for every device and used for

    control / configuration

    Non-endpoint 0: add as required by device

    Pipe

    Is a association between an endpoint and softwareon the host

    Stream pipe and message pipe

    Endpoints and pipes

  • 7/30/2019 USB Fundamental

    20/32

    20Mikes

    Endpoints and pipes

    Central to the USB communication model is the abstract concept of transferring data using pipes between

    the host and peripherals. This pipe medium can be further distributed into even smaller pipes, with

    each type of data requiring a separate tiny pipe. Each tiny pipe (endpoint) carries a unique data type

    that is needed between the peripheral and the host. For instance, in a multimedia USB device,

    different endpoints would be required for voice (isochronous), data (bulk), and control information.

    Thus a total of 5 endpoints are required, since two endpoints are needed for bidirectional data (see

    Figure 4). All these data types must be treated differently and The Cypress EZ-USB family has the

    most endpoints available in the market, supporting the maximum number of 31 endpoints allowed in

    the USB specification. With the vast number of endpoints, users have the flexibility to assign different

    buffers for each individual data stream, instead of consolidating various data streams into a single

    data type to be used for transmission. In addition, these endpoints can be programmed to be double-buffered, which improves transfer bandwidth in some applications.

    Some of the USB DevicesAvailable

  • 7/30/2019 USB Fundamental

    21/32

    21Mikes

    Some of the USB DevicesAvailable

    EZ USB Common

  • 7/30/2019 USB Fundamental

    22/32

    22Mikes

    EZ-USB CommonArchitecture

    Enhanced 8051

    SmartSIE

    8Kbytes

    of RAMD+D-

    5 - 10X faster than standard 8051

    Uses industry standard tools

    Download firmware from PC

    Easy & fast code development

    Update customers via website

    Up and running in minutes

    More efficient code

    Quick learning curve

    Compliance guaranteed

    Full Integration

    What makes it EZ?

  • 7/30/2019 USB Fundamental

    23/32

    23Mikes

    What makes it EZ?

    Protocol & Enumeration done by Smart SIE instead of micro F/W

    Outside intelligence

    handles all USB

    requests

    Unrecognized

    requests answered

    with stall

    USB

    Host

    Request

    Dumb SIE

    (SERDES)

    DSP,

    uP,ASIC,

    etc.Device

    Response

    Stall

    DSP,

    uP,

    ASIC,

    etc. Only unrecognizedrequests pass to micro

    Outside intelligence

    handles only custom

    requests

    SIE automatically

    handles basic USB

    requests (enumeration)

    USB

    Host

    RequestSmart

    SIE

    Device

    Response

    Stall

    EZ-USB FX

  • 7/30/2019 USB Fundamental

    24/32

    24Mikes

    EZ-USB FX

    Address (16)8051 Core48 MHz,

    4 clocks/cycle

    CYSmartUSB

    Engine

    12 MHz

    XTAL

    I/O Ports (40)

    4 KBor

    8 KBRAM

    2 KBFIFO

    Address(16)/Data

    Bus(8)

    X4PLL

    I2C

    Four

    64 bytes

    FIFO

    8/16

    bits

    Data(8)

    DMA EngineEZ-USBFX

    USBXCVR

    High Performance MicroUsing Standard Tools

    MemoryExpansion

    orData Buffer

    Ports

    PeripheralI/O Flexibility

    1K Double-BufferIsochronous Support

    "Soft Configuration"

    Easy Firmware Changes

    Enhanced USB Core

    Simplifies 8051 Code

    Master orSlave

    Operation

    Abundant I/OIncluding 2 UARTS

    Up to 48 MBytes/sBurst Rates

    GPIF

    GeneralProgrammable I/F toany ASIC/DSP or bus

    standards such asATAPI, EPP, etc.

    Uses Low-Cost Crystal

    D+

    D-

    EZ-USB TX2

  • 7/30/2019 USB Fundamental

    25/32

    25Mikes

    EZ-USB TX2

    Cypress

    USB 2.0

    Transceiver

    SIE

    Interface

    NRZI &Bit Stuffing

    Encoder

    NRZI &

    Bit Unstuffing

    Decoder

    PL

    L 1616-bit

    Bi-directional

    Data

    D+

    D-

    24 MHz Xtal

    TX/RXData & System

    Control

    Cypress Designed High-Speed Transceiver

    Cypress

    USB 2.0

    Transceiver

    PL

    L

    UTMI compliant USB 2.0 transceiver

    16-bit bi-directional 30Mhz interface

    Bus-powered capability with suspend mode

    EZ-USB SX2:

  • 7/30/2019 USB Fundamental

    26/32

    26Mikes

    EZ-USB SX2:USB 2.0 Serial Interface Engine

    D+D-

    PLL

    CY Smart USBSerial Interface

    Engine

    4 Kbyte

    FIFO

    USB 2.0Xcvr

    FIFO

    Data

    Bus

    EZ-USB SX2

    Internal Control Logic

    Fixed Logic for

    Control Function

    EZ-USB SX2

    Internal Control Logic

    Intelligent SIEReduces USB Learning Curve

    CY Smart USBSerial Interface

    Engine

    USB 2.0Xcvr

    CY DesignedHigh-Speed Xcvr

    Slave FIFO

    Interface

    (8/16-bit)

    FIFO

    Data

    Bus

    RESET WAKEUP

    Address

    DMA Request

    Interrupt, Ready

    RD, WR

    OE, PKTEND

    IFCLK

    24 MHzCrystal

    EZ-USB Development Tools

  • 7/30/2019 USB Fundamental

    27/32

    27Mikes

    EZ USB Development Tools

    Host PCUSB Cable and

    RS-232C Interface cable

    AN2131QC orCY7C64613-128NC

    Peripheral

    Function

    EZ-USB

    Also Included:

    - EZ-USB Control Panel

    - 8051 C Compiler, Assembler,Debugger/Monitor (Keil)

    - USB Firmware Source Library

    - General-Purpose Device Driver(Source Code)

    - Firmware Example Code

    Industry Recognized

    Development Platform

    Used by Intel and Most of the

    Motherboard Manufacturers

    EZ-USB xX2

  • 7/30/2019 USB Fundamental

    28/32

    28Mikes

    EZ USB xX2Development Kits

    HARDWARE Development Board

    Prototype Board

    SOFTWARE Firmware Source Library

    Firmware Frameworks Device Driver Source 8051 USB Examples EZ-USB Control Panel

    DOCUMENTATION Technical ReferenceManual Datasheet Application Notes Getting Started Errata Sheets

    High Speed (USB 2.0)

  • 7/30/2019 USB Fundamental

    29/32

    29Mikes

    High Speed (USB 2.0)Reference Designs

    Mass Storage Reference Design/Eval Kit EZ-USB FX2 Based (CY7C68013-56PVC, SSOP)

    Firmware source and object code

    Custom drivers and support for Windows class drivers Design notes

    Hardware files (schematics, bill of materials, Gerber files)

    Support for up to UDMA-100 and All PIO Modes

    Note: For Fixed Function solution, use ISD-300A1

    USB 2.0 to ATA CY4615ATA-& compatibility for large capacity drive support

    ATA IRQ support fo greater device compatibilityMultiple hardware design: vertical mount, horizontal mount, cable

    Hardware adapter for 2.5 drivers included in kit

    Documentation

    RTOS support

  • 7/30/2019 USB Fundamental

    30/32

    30Mikes

    RTOS support

    Opperating systems supported withdrivers for the host controllers: LINUX

    VxWORKS

    Windows (CE?)

    Simple mini port drivers to support RTOSwithout a USB host stack

    USB On The Go (OTG) Goals

  • 7/30/2019 USB Fundamental

    31/32

    31Mikes

    ( )

    Maintain spirit of USB Host-Peripheral, not Peer-to-Peer

    Keyed connectors ensure correct topologies

    No silent failures

    Minimize deviations from core specification Mechanical, Electrical and Software

    Address unique needs of portable devices Smaller connectors

    Be both a host and a peripheral

    Lower power output

    Turn-off interface when not in use

    Limited memory for drivers

    Typical Applications

  • 7/30/2019 USB Fundamental

    32/32

    32Mikes

    yp ca pp cat o s

    Mobile Applications

    Cell Phones

    PDAs

    Video Cameras

    Digital Still Cameras

    MP3 Players

    Mass Storage Devices