Title: USB
1USB
- USB Universal Serial Bus
- Industry-led open standard
- USB Implementers Forum USB-IF
- Intel, Microsoft, HP, Compaq
- Evolution
- USB 1.0 (1996)
- USB 1.1 (1998)
- USB 2.0 (2000)
2Why USB?
- Shortcomings of existing PC IO
- Scarcity of PC HW resources (IRQ and DMA
channels, IO space) - Serial Port/Parallel Port Single point-to-point
connections - Diversity of connectors and cables.
- Non hot-pluggable. Non-PnP
- Poor data bandwidth
- Cost of cables / connectors
- No power delivery through interface
3Why serial? Why not parallel?
- Advantages of serial buses
- Signal IntegrityFewer coinciding signal
transitions. Less crosstalk. Less noise. Less
inter-signal skew. - CostDrivers, connectors, cables, receivers
- Disadvantage of serial buses
- Higher clock-rates required for given bandwidth
4External Bus Options
BANDWIDTH
APPLICATIONS
ATTRIBUTES
DEVICE COST
STD FEATURE
Very Low cost Ease of Use Lots of fanout
LOW 10 - 100Kb/s
5-25
1997
Input Devices Control Functions
USB
MEDIUM 200K - 10Mb/s
15-150
1997
Telephony/ Modem Audio, Scanner
Low cost Guaranteed latency
1394A for CE
HIGH 100 - 400Mb/s
100-500
TBD
Entertainment, A/V Imaging
Peer-to-peer Multiple channels
1394B Gigabit
COMPUTE 1 Gb/s
200-500
1999
Primary Disk Home Backbone
Very High bandwidth Fiber capability
USB Focus on Low Cost,High Volume Applications
USB Ver 2.0 Supports 480Mb/s
5PC Connectivity Vision
USB in 1996 Initially introduced as an
incremental connector for new applications.
USB
Keyboard
Serial Port
Sound/Game Ports
Modem
LAN
Mouse
Parallel Port
Graphics Port
SCSI Port
USB Future The PC evolves into a simpler, easier
to use appliance.
Telephony, Modem, Kyb, Mouse, Joystick, Still/
Motion Camera, Digital Audio, Backup
Store, Printer, Scanner, Wireless Adaptors
Graphics Port
LAN
6Universal Serial Bus (USB) - Introduction
- Complex, hierarchical standard
- Requires software layers both on the host
computer and on the USB device - Serial Protocol and Physical Link
- Hierarchy PC is the host
- Upstream points towards the host
- Downstream points away from the host
7Introduction (2)
- Data transmitted serially
- Data transmitted differentially on a pair of
wires (D and D-) - 2 other wires are used to supply power to USB
devices - USB devices may be Bus Powered or Self-Powered
- USB includes specs on power consumption and
voltage drops etc
82 Types of USB Cable
- High Speed Cables
- Shielded, jacketed - use twisted pair wiring
- Support max data rates of 12Mb/s
- Support Cable lengths of 5m
- Low Speed cables
- Not shielded, pairs not twisted, cheaper
- Support 1.5Mb/s
- Support Cable lengths of 3m
9USB Connectors
- Connectors
- 4-Position with shielded housing
- Positive Retention
- Blind Mating Capabilities
- Cables
- 28 AWG twisted pair for signalling
- 20-28 AWG pair for power
- Shielding for fully rated segments
10Type A B connections
Type A Connector connects to Upstream Ports Type
B Connector connects to Downstream Ports Each USB
Cable has a Type A Type B Connector
11Power Distribution
- Significant capability of USB
- Eliminate wall adaptors
- Hubs may be self-powered or bus-powered
- Two current levels 100 500 mA
- Overcurrent protection for safety
- Wire gauge options 20-28 AWG
12Data Signalling
- Bi-directional, half-duplex link
- Embedded clock and dataNRZI Non Return to
Zero, InvertedNRZI with Bit Stuffing - Differential signal pair
13USB Bandwidth
- USB 1.0 / 1.1
- 12 Mb/s Full Speed (FS) bit rate
- 1.5 Mb/s Low Speed (LS) bit rate
- USB 2.0 (May 2000)
- additionally 480 Mb/s High Speed (HS)
- Applications USB HDD. Video
14Connections and Terminations
R2
D
D
F.S./L.S. USB Transceiver
F.S. USB Transceiver
R1
D-
(45O Outputs)
ZO 90O15 5 Meters Max.
(45O Outputs)
D-
Hub Port 0 or Full Speed Function
R1
Host or Hub Port
R1 15KO5 R2 1.5KO5
D
D
F.S./L.S. USB Transceiver
L.S. USB Transceiver
R1
R2
D-
(45O Outputs)
3 Meters Max.
(45O Outputs)
D-
R1 15KO5 R2 1.5KO5
R1
Host or Hub Port
Low Speed Function
15USB Transceiver
- Differential Driver
- Slew rate controlled
- SE0 drive capability
- Differential Receiver
- Sensitivity lt200mV
- Common mode range lt 1.0V to gt 3.0V
- Single-Ended Receivers
- Threshold 0.6V - 1.5V
16Tiered Star Topology
17Tiered Star Topology
- Tiered Star Topology
- Distributed connectivity points
- Up to 6 Tiers
- Up to 5m cable length per segment
- Up to 127 Devices
18Hosts, Hubs, Devices
- Only one host per system usually the PC
- Host (Root Hub) is the USB system master
- Controls and schedules all communications
- Hubs are communication nodes that interconnect
devices - Peripherals controlled by the USB bus are slaves
that respond to host commands - Peripherals are called USB devices or functions
19Hubs
- USB Devices themselves
- Bridges that increase logical and physical
fan-out of the network - Single Upstream connection
- To Root Hub (host) or next hub nearer host
- One or more downstream connections
- Hubs detect connection/removal of USB devices
Topology Changes
20USB Hub Function
- Port Control
- Connection detect
- Port Enable/ Disable
- Reset/ Resume Signaling
- Data Switch
- Signal Regeneration
- Robustness/ Recovery
- Power Distribution
21Enumeration
- Process that occurs when a new peripheral is
connected to the USB network - Host communicates with the peripheral to find out
what device driver is needed - Host supplies a device address during enumeration
- Hence no switches to set up addresses
22Hubs in logical connection
- After Enumeration the hub becomes logically
invisible to the application - Application code sees a logical connection
directly from the host to each USB device
23USB Pipes
- USB Communication uses the idea of a Pipe
- The USB connection consists of a big pipe
(12Mb/s) and up to 127 small pipes - Each of the small pipes connects to a USB device
- Each small pipe can connect to a smaller pipe
(tiny pipe) up to 16 tiny pipes per small pipe
24USB Pipes Analogy With Physical Pipe
25Addresses and Endpoints
- USB Token has 7 address bits per USB device
- Address 0 USB Default address is used for all
devices when first attached - Hence 127 USB Devices (small pipes)
- 4 Endpoint bits in a USB token allow up to 16
pairs of tiny pipes per small pipe - Endpoint 0 just for Control transfers
- USB Tokens also identify IN or OUT direction
- 15 bi-directional sources or receivers of data
per USB Device identified by Endpoints
26USB Pipes and Endpoints
- All USB transfers occur through virtual pipes
associated with Endpoints - Each Pipe may have different bandwidth and may
require different types of data transfer - Each endpoint associated with a descriptor
- Type of Data Transfer
- Max size of data packets
- Interval for transfer, bandwidth needed etc
27Endpoints
- Device may have a number of endpoints
- E.g. Different Endpoint (and pipe) for
- Data
- File transfers low error rate necessary
- Voice
- Error tolerant but not delay tolerant
- Control
- Low error rate but lower data rate
28Basic USB Model
Host
Device
Interconnect
Capability
Function
Client SW
USB Logical Device
Provides common device abstraction
USB Sys SW
USB Bus
USB Bus
Physical Interface, Signalling
Interface
Interface
29Three layers in USB model
- Layers
- Function
- USB Device
- USB Bus Interface Layers
- Comments
- Based on 7-layer OSI Model
- Entities at the same layer have a virtual
peer-to-peer connection - Entities at lower layers provide services to
entities at next higher layer - Progressively hides details from higher layers
30USB Host Layers
- USB Bus Interface
- Physical interface to wire
- Manages low-level protocol
- USB System Software
- Provides interfaces to driver layers
- Manages standard device objects
- Client Software
- E.g. device drivers
- Manages capability
31USB Device Layers
- USB Bus Interface
- Physical interface to wire
- Manages low-level protocol
- USB Logical Device
- Defines common view of device by host
- Manages high-level protocol
- Function
- Represents capability delivered bythe device
32Detailed Host/Device View
33Client Software lt-gt Function
Client Software
Host
Buffers
Data Flows
Pipes
Endpoints
USB Device
Interface
34USB Data Transfer Types
- USB supports four transfer types
- Control
- Bulk
- Interrupt
- Isochronous
35Transfer Type Control
- Control
- Exchange configuration, set-up and command
information between the device and the host - CRCs are used for error checking as error-free
transmission is critical - Re-transmission initiated when errors are
detected - Control endpoints are implemented on Endpoint 0
pair - Control transfer has 2 or 3 stages setup stage,
optional data stage, status stage
36Transfer Type Bulk
- Bulk Transfers
- Large amounts of data where data is not
time-critical - Error free transfer important hence CRC
error-checking implemented - Claim unused bandwidth when nothing more
important is going on - Typical applications scanners, printers
37Transfer Type Interrupt
- Interrupt
- Not interrupts in normal sense!
- Unidirectional - only inputs to the host
- Small data transfers that occur infrequently
- Host polls polls interrupt endpoints to see if
they have any data to send - Full speed devices 1ms - 255ms polling
- Low speed devices 10ms - 255ms
- Error checking validates the data
- Mice and keyboards
38Transfer Type Isochronous
- Isochronous
- Unidirectional or bidirectional
- For time sensitive information, e.g. audio or
video streaming - System must be able to tolerate some errors
- No time for error checking
- Guaranteed access to USB with bounded latency
- No Retries
- Max packet size for isochronous transfer is
1023B/frame - Max isochronous bandwidth is 8.184Mb/s
39Communication Layers (1)
- Frame
- Time between SOF tokens 1ms
- Consists of a series of transactions
- Transfer
- One or more transactions to move data between
client software and the function - Packet
- Bundle of data organised in a set format for
transmission - Types Token, Start of Frame, Data, Handshake,
HS/LS Preamble - Typically has Control information, Data to be
transferred and Error detection and correction
40Communication Layers (2)
- Transaction
- Grouping of no more than 3 packets
- Host initiates a token packet according to
schedule - PID identifies transaction type
41USB Packets 4 types
- Packet
- Bundle of data organised in a set format for
transmission - Typically has Control information, Data tobe
transferred and Error detection and correction
- Token
- SOF (Start of Frame)
- Data
- Handshake
- HS/LS Preamble (optional)
- All packets have
- Sync field to lock the Phase Locked Loop
- Followed by Packet Identifier (PID)
- Also address, frame number or data
42Token Packet
43Packet Identifier
44SOF Packet
SOF packets are sent by the host once every
1.00ms /- 0.05ms
45Data Packet
Devices respond to requests from the Host Host
sends an IN and device endpoint responds with a
packet OR Host sends an OUT followed by a data
packet Bulk, Control, Interrupt host responds
with an Acknowledge Isochronous no handshake
packet
46Handshake Packet
Special Packet
Host sends a PRE (preamble) packet when it wants
to communicate with 1.5Mb/s devices
47USB Frame Model
48USB and the PC
- Windows 95 no USB support until OSR2.1
- No longer officially supported
- Windows 98 contains USB drivers for common
applications - Windows NT no USB support
- Windows 2000/XP provides USB support for common
applications