Universal Serial Bus
Universal Serial Bus
Universal Serial Bus
1
Overview
Introduction
Components
Protocol
Icons
Developments
USB OTG
2
What Is USB?
3
Why Use USB?
Single port for many devices.
Plug and play.
Automatic detection of device.
No need to restart the system.
Speed flexibility.
6. Low speed
7. Full speed
8. High speed
Robust – error detection capability.
4
COMPONENTS
6
7
Standard Cables
5 m maximum length (shorter for
low-speed)
26 ns maximum delay between ‘A’ plug
and ‘B’ plug
125 mV maximum voltage drop
4 conductors plus shield
D+ and D- (twisted) data pair
VBUS (power)
Ground
8
Electrical Signaling (1)
Three Signaling rates
High-Speed == 480 Mbps
Full-Speed == 12 Mbps
Low-Speed == 1.5 Mbps
Basic signals
Idle
Reset (only full- and low-speed; long
enough SE0)
Suspend (more than 3 ms of continuous
idle)
Resume 9
Electrical Signaling (2)
Data moved via ~Differential
Signaling
Full- and Low-Speed – USB 1
specification
High-Speed - USB 2 specification
NRZI with bit-stuffing
baseband transmission
10
Protocol - Transactions
Packets always part of a transaction
Transactions always target a Device
Endpoint (source or sink)
Transit via a Pipe that connects Host
& Device
Transactions have 1 to 3 components
Host “talks”, Device “answers”
Token packet (always present and from
host)
Data packet (direction as specified by
Token) 11
Endpoint
Endpoint : source or sink of data
Also a interface between hardware
and software.
Every device will many pairs of buffer
One is used for IN transaction
Other is used for OUT transaction
12
Pipes
Logicalconnection b/t host &
endpoints
Parameters
Bandwidth
Type of transfer
Packet size
Buffer size etc
13
Packet Id
Basically4 bits
But a byte is used for PID
Every packet should have PID field
Pid Pid P P P P P P
0 id2 id3 id4 id5 id6 id7
1 nibble is complement of lower
Higher
nibble
Advantage
Self check (i.e., CRC is not used to check the
PID)
14
Token packets
In
Host ready to receive data
Out
Host ready to send data
SOF
Start of frame
16
Data packets
Data 0 , Data 1 ?
3 to 1026 bytes – High speed USB
11 bytes – Low speed USB
o Polynomial 16 ?
All 4 errors can be detected
Single bit error
Two bit error
Odd error
Burst error
18
Handshake packets
ACK , NAK , STALL
ACK – Positive acknowledgement
NAK – Negative acknowledgement
STALL – The device finds its in a state that it
19
Descriptors
Information to the host about device
Type of device , Manufacturer ,
Version ,
number of endpoints and
configuration
example:
Device descriptor: Vendor id ,USB
compatibility
Configuration descriptor: Power , interface type
Endpoint descriptor: To determine bandwidth
for the 20
bus
Working
21
SERIAL INTERFACE
ENGINE
Part
of both the host's and the
device's physical layer
FUNCTIONS
SERIALIZATION AND DESERIALIZATION
NRZI ENCODING AND DECODING
BITSTUFFING AND DESTUFFING
CHECKSUM GENERATION AND ERROR
CHECKING
PID , EOP , SOP DETECTOR
22
IN TRANSACTION
ORIGINAL DATA + CHECKSUM
PARALLEL TO SERIAL
BIT STUFFING
NRZI ENCODING
OUT TRANSACTION
NRZI DECODING
BIT DESTUFFING
SERIAL TO PARALLEL
CRC CHECK
23
ICONS
24
USB OTG
25
What is USB OTG ?
27
OTG Dual-Role Device
Visit
www.usb.org
www.usb.org/developers/onthego
http://www.howstuffworks.com/
http://www.trenz-electronic.de/down/dwdten.ht
30