Transcript 19. USB

USB (Universal Serial Bus)
• Need for “Plug and Play” capability for PC
peripherals outside of PC
• Supports hot plugging
• Inexpensive solution for low to medium speed
applications (v. 2.0  480Mbps)
• Tiered star topology (hubs)
– Expands to 127 peripherals
• Supports 2 kinds of transfer
– Asynchronous (delay between packets)
– Isochronous (planned delivery of data, e.g.,
multimedia applications)
Winter 2003
EE
EE 766
Computer Interfacing and Protocols
18 - 1
USB
• Need for peripherals expansion outside of PC
– Want to connect new device without opening the case
– Do not want to use PC serial or parallel ports
– Want to be able to “hot swap” devices without power
off or rebooting
– Want to be able to service low, medium (full), and
high speed devices (1.5-12-480 Mbps)
– Want a lot of extension capability (127)
– Want the device end interface simple and cheap
– Want interface to supply some power
Winter 2003
EE
EE 766
Computer Interfacing and Protocols
18 - 2
USB Packets
• Parts of packet
– SYNC
– PID (Packet Identifier)
– EOP (End of Packet)
• Sync
8 Bits
D+
(Idle J)
K
J
K
J
K
J
K K
D-
Winter 2003
EE
EE 766
Computer Interfacing and Protocols
18 - 3
USB Signaling
• Differential Encoding used
– NRZ-I
• 0  Transition
• 1  No transition
– Bit stuffing used
• 0 stuffed after 6 consecutive 1s
• Note the difference from HDLC
Winter 2003
EE
EE 766
Computer Interfacing and Protocols
18 - 4
USB Features
• Serial
• Half duplex medium
• All control originates from PC
(Access not distributed)
• Operating system must recognize new devices at any
time
• Information sent in packets
• Information types
–
–
–
–
Control
Interrupt (polling)
Bulk (good delivery)
Isochronous (guaranteed rate)
Winter 2003
EE
EE 766
Computer Interfacing and Protocols
18 - 5
USB Signaling
• Differential voltage signaling
• Bus states
– D+ high, D- low  J (Idle)
– D+ low, D- high  K
• Bus can float if neither end drives
• SE0 (single ended zero)
– D+, D- low
• SE1 (single ended one)
– D+, D- high
Winter 2003
EE
EE 766
Computer Interfacing and Protocols
18 - 6
USB Mechanical Aspects
• Cable length limited to 5m
• Interface is serial, differential
• Host or hub supplies up to 500mA at 5V
downstream
– Cable has 4 wires VCC, GND, D+, D-
• V. 1.1: Cable must be shielded for 12Mbps
• V. 2.0: Max speed 480Mbps
• Automatic speed sensing
Winter 2003
EE
EE 766
Computer Interfacing and Protocols
18 - 7
USB Mechanical Aspects
• Cable ends distinctive
– Flat vs. square
• Power pins longer so power is stable when
data is connected
• Up to 5 levels of hub hierarchy
– Speed degradation if all devices are active
together
Winter 2003
EE
EE 766
Computer Interfacing and Protocols
18 - 8