8/17/2019 USB Introdução
1/34
Universal Serial Bus (USB)
EE 446 Embedded Architecture
8/17/2019 USB Introdução
2/34
Universal Serial BusA representative peripheral interface
Universal Serial Bus (USB) provides a serial bus standard for connecting devices, usually to a computer, but it also is in use on other
devices such as set-top boxes, game consoles and PDs! ("i#ipedia!org)
8/17/2019 USB Introdução
3/34
What USB Can Do USB is a li#ely solution any time you "ant to use a computer to communi
cate "ith devices outside the computer!
$he interface is suitable for one-of-#ind and small-scale designs as "ell as
mass-produced, standard peripheral types!
Device, male connector %omputer, female connector &ub
8/17/2019 USB Introdução
4/34
%omparisonInterface Format Number of Devices
(maximum)
Length
(maximum,
feet)
Speed
(maximum,
bits/sec.)
!pica" #se
USB asynchronous
serial
127 16 (or up to
96 ft !ith "
hubs#
1"$% 12$%
4&'$
$ouse%
eyboard% dis
dri)e% modem%
audio
*S+2,2
(E-A./-A+2,2#
asynchronous
serial
2 "'+1'' 2' (11"
!ith some
hard!are#
$odem% mouse%
instrumentation
0arallel
0rinter
0ort
parallel 2 (& !ith
daisy+chain
support#
1',' &$ 0rinters%
scanners% dis
dri)es
-EEE+1,94
(ire3ire#
serial 64 1" 4''$
(increasinto
,25 !ith
-EEE+1,94b
ideo% massstorae
8/17/2019 USB Introdução
5/34
' evel
8/17/2019 USB Introdução
6/34
Benefits for Users Ease of Usease of use "as a ma*or design goal for USB, and the result is an interface that+s a pleasure touse for many reasons
One interface for many devices.USB is versatile enough to be usable "ith many #inds of peripherals! nstead of having a diffe
rent connector type and supporting hard"are for each peripheral, one interface serves many!
Automatic confiuration..hen a user connects a USB peripheral to a computer, its /S automatically detects the peripheral and loads the appropriate soft"are driver!
!ot plua"le .e can connect and disconnect a peripheral "henever you "ant, "hether or not the systemand peripheral are po"ered, "ithout damaging the P% or peripheral! $he operating system detects "hen a device is attached and readies it for use!
#o po$er supply re%uired (sometimes)! peripheral that re0uires up to 122 milliamperes can dra" all of its po"er from the bus instead of having its o"n supply!!
8/17/2019 USB Introdução
7/34
USB
USB 1.0 specification introduced in 1994
USB 2.0 specification finalized in 2001
Became popular due to cost/benefit advantageEg. EEE 1!94 " #ig# band$idt#% #ig# cost
ree generations of USBUSB 1.0
USB 2.0
USB !.0 and 'USB
8/17/2019 USB Introdução
8/34
USB &.' big step in USB+s evolution "as version 3!2 support for much faster transfers! a 42-times increase "as found to be feasible, for a bus speed of 452
6egabits per second!
&o" to use itUSB 3!2 is bac#"ards compatible "ith USB 7!7! 8ersion 3!2 peripherals can use the same connectors and cables as 7!x
peripherals! $o use the ne", higher speed, peripherals must connect to 3!2-compli
ant hosts and hubs! 3!2 hosts and hubs can also communicate "ith 7!x peripherals! 3!2-compliant hub "ith a slo"er peripheral attached "ill translate a
s needed bet"een the peripheral+s speed and high speed! $his increases the hub+s complexity but ma#es good use of the bus ti
me "ithout re0uiring different hubs for different speeds!
8/17/2019 USB Introdução
9/34
USB 9!2 /vervie"
(lso referred to as SuperSpeed USB
Speeds 10) faster t#an 2.0 *+ ,bps in controlled test environment-
&ransfer of 2+ ,B file in appro) 0 seconds *see c#art-
E)tensible " esigned to scale 2+,bps
ptimized po$er efficienc
3o device polling *asnc#ronous notifications-
o$er active and idle po$er re5uirements
Bac6$ard compatible $it# USB 2.0 USB 2.0 device $ill $or6 $it# USB !.0 #ost
USB !.0 device $ill $or6 $it# USB 2.0 #ost
8/17/2019 USB Introdução
10/34
USB 9!2:SuperSpeed: bus provides a fourth transfer mode
at 1!2 ;bit
8/17/2019 USB Introdução
11/34
USB versus EEE*+,- -79>4 is best suited for video and other lin#s "here speed is essential or a
host P% isn+t available!
USB is best suited for typical peripherals such as #eyboards, printers, scanners,and dis# drives as "ell as lo"- to moderate-speed, cost-sensitive applications!?or many devices, either interface "ould "or#!
.ith USB, a single host controls communications "ith many peripherals! -79>4 uses a peer-to-peer model, "here peripherals can communicate "i
th each other directly!
single communication can also be directed to multiple receivers!
-79>4+s 422 6egabits per second is more than 92 times faster than USB
7!x+s 73 6egabits per second!
s USB is getting faster "ith version 3!2, -79>4 is getting faster "ith theproposed -79>4!b!
8/17/2019 USB Introdução
12/34
Physical ppearances
$ype connectors on host devices that supply po"er
$ype B connectors on target devices that receive po"er!
8/17/2019 USB Introdução
13/34
%ommunication ?lo"
8/17/2019 USB Introdução
14/34
he /hysical 0ayer
8/17/2019 USB Introdução
15/34
Signaling /n $he Bus
$he USB cable is 4 "ire cableSignal on the bus is done by signaling over t"o "i
res ( D@ and DA )
Data encoding and decoding is done using C (on Ceturn to ero nverted )a 2 bit is transmitted by toggling the data linesa 7 bit is transmitted by leaving the data lines as-is!
8/17/2019 USB Introdução
16/34
S
S E Serial nterface ngine
t is part of both the host7s and the device7s physical layer
FGSerialiHation and De-serialiHation
FGncoding and Decoding
FG;enerate(for out) and 8erify(for in) %C%
FGDetect PD
8/17/2019 USB Introdução
17/34
&%
&% E &ost %ontroller
FGt is an additional hard"are to ensure that everything "hich is transmitted on the bus is correct
FGt serves both the USB and the host and has thesame functionality in every USB system
8/17/2019 USB Introdução
18/34
he /rotocol Enine 0ayer
8/17/2019 USB Introdução
19/34
Cesponsible for the translating the data bet"een the application layer and the USB transactions protocol !
$"o ColesFGUSB System Soft"are (in the USB host)
FGUSB ogical Device (in the USB device)
8/17/2019 USB Introdução
20/34
$he USB System S.
%ompose of $he &ost %ontroller Driver and $he USB Driver
Cesponsible for
FGBand"idth allocation
FGbus po"er management
$"o of above are in order to enable devices to acc
ess the bus
8/17/2019 USB Introdução
21/34
$he USB ogical Device
%ompose of a collection of independent endpoints
ach endpoint has an uni0ue ndpoint umber and is unidirectional(except endpoint Hero and has t"o type--n
8/17/2019 USB Introdução
22/34
he Application 0ayer
8/17/2019 USB Introdução
23/34
&ost end E %lient Soft"are
F G6anages the appropriate interface by
transferring data from its buffers to theendpoint "ith the appropriate interface
Device end E ?unction
F G%omposed of interfaces and controls the functionality of the device
8/17/2019 USB Introdução
24/34
Pipes
$he logic communication bet"een the client
soft"are on the host and the function on the
device is done through pipest is a association bet"een a specific
endpoint on the device and the appropriate
soft"are in the host
8/17/2019 USB Introdução
25/34
Pipes (continued)
n endpoint is the source or destination of thedata that transmitted on the USB cable
n endpoint of a pipe is addressable "ith a tuple (deviceAaddress, endpointAnumber)
$"o direction
FG/U$ E
data flo"s from the host to the device
FG E
data flo"s from the device to the host
8/17/2019 USB Introdução
26/34
USB 0acet /ypes
8/17/2019 USB Introdução
27/34
?our $ypes of Data $ransfers (Pipes)
1essae /ipeControl transfers %ontrol transfers are bidirectional transfers used by the USB system soft"are
mainly to 0uery, configure, and issue certain generic commands to USB devices! %ontrol transfers typically ta#e place bet"een the host computer and the USB deviceIs endpoint 2, but yourcontrol transfers might use other endpoints!
Stream /ipenterrupt transfers are used "hen a peripheral "ants to be JpolledK by the host periodically to
see if it has data to send to the host! Leyboards, mice, and *oystic#s are examples of devices that typically use interrupt transfers!
Bul2 transfers are used to move data bet"een the host system and the peripheral "hen data integrity is more critical than data latency, and they also include error chec#ing and retries if errors are detected! Printers, scanners, and storage devices are examples of devices that dependprimarily on bul# transfers!
sochronous transfers are used for moving Jreal-timeK data! n these transfers, the streaming of the data is more critical than the accuracy of the data! $here is no error-chec#ing or retries as
sociated "ith isochronous transfers! .eb-cams, spea#ers and microphones are examples of devices that utiliHe isochronous transfers!
8/17/2019 USB Introdução
28/34
8/17/2019 USB Introdução
29/34
8/17/2019 USB Introdução
30/34
USB /n-$he-;o (/$;)Celeased in December 322M!
USB /n-$he-;o ma#es it possible for t"o USB devices to communicate "ith each other "ithout re0uiring a separate USB host!
n practice, one of the USB devices acts as a host(device roles change) for the other device!
?or example usb flash drive (peripheral) served by a printer (ho
st)=
#eyboard (peripheral) connected to a mobile phon
e (host)
8/17/2019 USB Introdução
31/34
USB /$; supported by 6icro-Bn /$; product must have a single 6icro-B rece
ptacle and no other USB receptacles!
.hen attached to a P%, (host)
N an /$; device re0uires a cable "hich has a USB Standard- plug on one end
N and a 6icro-B plug on the other end! (Peripher
al)
8/17/2019 USB Introdução
32/34
n order to attach a peripheral to an /$; device (no" it serves as a host)the peripheral either needs to have a cable ending in
a 6icro- plug "hich is inserted into the /$; deviceIs 6icro-B (same physical appearance as 6icro-
receptacle) "ith receptacleor the /$; device itself needs an adapter cable "hic
h has a 6icro- plug on one end and a Standard- receptacle on the other! $he adapter cable enables a
ny standard USB peripheral to be attached to an /$; device! (see belo")
8/17/2019 USB Introdução
33/34
n order to attach t"o /$; devices together re0uires either a cable "ith a 6icro-B plug at one end and a 6icro- plug at the other or can be achieved
using a combination of the P% cable and adapter cable!
8/17/2019 USB Introdução
34/34
USB 9!2 Bus rchitecture
perates concurrentl $it# USB 2.0*ual bus arc#itecture- 8ec#anicall and electricall
bac6$ard/for$ard compatible
evices configured at fastest signaling
rate
ubs contain additional ports Speed and po$er efficienc
3on polling reduces po$er
consumption
(dditional data lines included to
increase speed
Efficienc of band$idt# "simultaneous communication bet$een
#ost and device edicated in and out lines allo$
communication bet$een #ost and
device
Top Related