Вы находитесь на странице: 1из 49

NAVEEN KANUMURI

USB 2.0
Street Talk
USB 2.0 STREET TALK
1
Before USB...
Adding peripherals can be time consuming and
problematic
Too many different connectors types
Keyboard, Mouse, Serial port , Parallel Port,
Requires an add-in card to use your latest
peripheral purchase
This assumes a reasonable level of technical
competence
You have switch off your PC, open the case, install
card, during which the user could damage the PC
No hot attachment of peripherals
USB 2.0 STREET TALK
2
USB Features
Low Cost
Hot Pluggable
Single connecter type
Max: 127 devices
Different device speeds
Cable Power
Power Conservation
Different transfer types
USB 2.0 STREET TALK
3
USB Applications
Low-Speed (LS)
1.5 Mbps
Mice
Keyboards
Joysticks
Gamepads
Full-Speed (FS)
12 Mbps
Modems
Digital Cameras
Printers
Scanners
Microphones
Legacy Conversion
Mass Storage
WebCams
Home Networking
TV Tuner Cards
Digital Video/Audio Technology
High-Speed (HS)
480 Mbps
USB 2.0 STREET TALK
4
USB
Speaker
Pen Mouse
Kbd
Mic Phone
PC
HUB
HUB HOST/HUB
Monitor
USB System Overview
Topology
Tiered Star
127 connections (max)
6 Tiers (max)

Bus Transactions
LS: 1.5 Mbps
FS: 12 Mbps
HS: 480 Mbps
Super Speed: 4.8Gbps

Configuration
Dynamic insertion/removal
Auto configuration

Master/Slave Protocol
All transactions are USB Host
centric
USB 2.0 STREET TALK
5
USB Device Types
Host
The master device in a USB system
Initiates all data transfer
Manages device attach/disconnect
Implements the Data Link Layer
functionality
Device or Function
The slave device in a system
Responds only to requests from the
Host
Cannot initiate data transfers
Provides USB connectivity to the
target device
Hub
Intermediary between Host and
Device
Allows for multiple port expansion
1-2 port, 1-4 port etc..
HS Hub
FS Hub
HS device connected to FS Hub will
work as FS device
USB 2.0 STREET TALK
6
USB Communication Flow
Endpoint
Characteristics
Bandwidth
requirement
Endpoint Number
Latency Requirement
Maximum Pkt Size
Transfer Type
Direction
Simplex transfer on
endpoint
Max Endp
31 for HS,FS
3 for LS

USB 2.0 STREET TALK
7
USB Electrical Characteristics
4 Wire Cable
2 Power supply wires
VBUS positive rail +5V
Ground
2 signal cables driven differentially
D+
D-
Signaling Levels
J state: Default Full Speed Idle State
D+ Pulled or driven HIGH
D- Pulled or driven LOW
K state: Default Low Speed Idle State
D+ pulled or driven LOW
D- pulled or driven HIGH
SE0: Default High Speed Idle State
D+ Pulled or driven LOW
D- Pulled or driven LOW

USB 2.0 STREET TALK
8
Signaling Protocol
Data is NRZI coded
A 1 is represented by no transition on D+,D-
A 0 is represented by J->K or K->J transition
Receive clock is recovered from the data stream using a PLL

Data is Bitstuffed
A 0 is forced into the data stream after 6 consecutive 1s
Allows PLL to remain locked
Transparently implemented in hardware

USB PHY is responsible for NRZI and Bitstuffing
J K JJJJJJJ SE0 KKK
1 0
0 111111 0 11
USB 2.0 STREET TALK
9
Handshake/Low Speed Preamble PID
8 bits
Data (Toggle)
DATA0/1
PID CRC16
16 bits
DATA
0-1023 bytes 8 bits
ADDR PID
8 bits 7 bits
ENDP
4 bits
CRC5
5 bits
Token (In/Out/Setup)
Frame Number PID
8 bits 11 bits
CRC5
5 bits
Start of Frame
All Packets are prefaced with SYNC Field and Terminated With EOP
Packet Formats
(CRC checksum excludes the PID)
NAVEEN KANUMURI
The USB 1.1
Specification
USB 2.0 STREET TALK
11
Handshake Data Transfer Token
Transaction Protocol
Host based token polling
Data from host-to-function and function-to-host
Host handles most of the protocol complexity
Peripheral design is simple and low-cost

Robustness
Handshake to acknowledge data transfer and flow control
PID check bits, CRC protection, plus hardware retry
option
Data Toggle Sequence bits
USB 2.0 STREET TALK
12
USB Protocol Layers
IRP
Transaction Transaction
Transfer
Token Handshake Data
Client Buffer
System Buffer
Bus Transaction
Three Phases
Transmission
USB 2.0 STREET TALK
13
USB Signaling
Default, no device connected, bus state is SE0
Device connection is indicated by transition from SE0
to either J or K
Connected device speed is indicated by the non SE0
state
J state means a full speed device has been connected
K state means a low speed device has been connected
SE0 J :- FS Connect SE0 K :- LS Connect
D+
D-
D-
D+
USB 2.0 STREET TALK
14
USB Frames
SOF SOF
1 mS
12000 Bit times
The USB protocol splits time into 1mS frames on the
bus
Each frame is started by a Start Of Frame (SOF) token
Bandwidth allocation is carried out per frame
1500 bytes available per frame
187.5 bytes in low speed
Protocol overhead reduces bytes available for
applications.
USB 2.0 STREET TALK
15
Isochronous Transfers
Applications: Audio, Telephony, Motion camera
Supported in Full Speed only for USB1.1
Generates a maximum of one transaction per frame
Max Payload: 1023 bytes
Transactions
Token, Data (NO Handshake)
Lossy
Errors Reported on a per-Packet basis
No hardware retry mechanism
One shot transfer
implies guaranteed delivery
Data Transfer Token
USB 2.0 STREET TALK
16
Bulk Transfers
Applications: Printer, Scanner, Still Camera
Transactions
Requires all 3 phases
In either direction (initiated by Host)
OUT from Host to Device
IN from Device to Host
Data payload limited to 64 bytes
Handshake Data Transfer OUT DATA
Handshake IN DATA
USB 2.0 STREET TALK
17
Bulk Transfers
No guaranteed access
Scheduled as bandwidth available
High bandwidth on idle bus, starved on busy bus
Bulk endpoints all fight for the same bandwidth
Guaranteed correct transfer
Failed transfers retried until the host gives up
Data Toggle synchronization guarantees correct
transfers
Supports Flow Control

USB 2.0 STREET TALK
18
Control Transfers
Mandatory Support by all devices
Uses default endpoint 0
Used for all initial enumeration tasks
Retries supported
Minimal access guaranteed
10% bandwidth reserved for Control
More as space available

USB 2.0 STREET TALK
19
Control Transfers
Transactions
Contains 3 stages: Setup, Data, Status
Each stage has 0 or more transactions
Setup required and device must accept
Bi-directional, data phase looks like Bulk
Max. data payload size 64 bytes for FS and 8 for LS
HSK IN 0 DATA
HSK Data Transfer OUT 0 DATA
HSK Data Transfer SETUP DATA
HSK Data Transfer SETUP DATA
HSK Data Transfer OUT DATA
HSK Data Transfer OUT DATA
HSK IN DATA
HSK IN DATA
USB 2.0 STREET TALK
20
Interrupt Transfers
Interrupt transfers use the same protocol as Bulk
transfers and look identical to a device.
Unlike Bulk there is guaranteed bus bandwidth
available
Transfers scheduled every n frames
Ideal for small, infrequent status updates
Only other protocol supported by Low speed devices
Max Payload : 64 bytes for FS, 8 for LS
SOF Control Isochronous Bulk SOF
1 mS
12000 Bit times
Interrupt
USB 2.0 STREET TALK
21
Power Saving Mode
Suspend State
Initiated by the Host when no traffic is required to be
sent to the devices
Allows the Host and Device PHY to go into low power
mode
Host stops SOF for 3 ms , detected by the device as a
Suspend condition
Exit States
Host initiated Resume: Initiated by Host Software
Device initiated RemoteWakeup: Initiated by device
when needed to wakeup Host
Ex: Any mouse movement
NAVEEN KANUMURI
The USB 2.0
Specification
The 2.0 specification
completely
encompasses the
previous 1.1 release.
This means that all
existing 1.1 devices will
be compatible with
new 2.0 systems.
USB 2.0 STREET TALK
23
Features added in USB 2.0
Faster data rate: 480 Mbps
New electrical signaling scheme
New device attachment speed detect mechanism
New in USB2.0 Protocol
8 Microframes for each frame
Standard FS frame is 1 ms
High-speed Micro SOF Frames are @125 us intervals
Enhanced ISO/INTERRUPT transfer protocol
High bandwidth transactions 2/3 transaction per frame
Low Level Protocol
New flow control mechanism (PING Token Introduced)
New packet payload size restrictions
Test Modes for PHY characterization
Split Transactions to Hubs for FS/LS downstream ports
New Power Saving Mode: L1 Sleep State
USB 2.0 STREET TALK
24
USB Frames and Microframes
Control Mouse Keybrd Audio Scan Printer Video
USB 1.1
Isochronous Interrupt Control Bulk
125 microseconds / microframe
60,000 bits/ uframe
3 2 1 0 7 6 5 4
1 ms/frame
125 s








USB 2.0












USB 2.0 STREET TALK
25
Low Level Protocol

Packet SYNC and EOP
Speed Identification Chirp
Suspend
End of Resume
Disconnect Detection

USB 2.0 STREET TALK
26
PING Packets
Add improved flow control for OUT transfers
Original spec has device response after complete
data transfer
If transfer is unsuccessful then there is much wasted
bandwidth
PING is used to determine if a device can
accept an OUT packet without sending all of
the data
NAK PING ACK PING Data Transfer OUT OUT
Data Transfer OUT OUT NAK
USB 2.0 STREET TALK
27
New packet restrictions
For low/full speed all restrictions remain unchanged
For High Speed
ISO payload increased to 1024 from 1023
Max. 3 transfers per microframe vs. 1 per frame
Bulk payload increased from 64 to 512
Interrupt payload increased from 64 to 1024 bytes
Up to 3 transfers/microframe vs 1 per frame
Control transfer payload fixed at 64 bytes

USB 2.0 STREET TALK
28
Split Transactions
High-speed split transactions used
by Hubs and Host
On Hub Downstream port is a
FS/LS device
Special PID type ERR (same value
as PRE!)
Two split transactions defined:
Start split (SSPLIT) and Complete
Split (CSPLIT)
HS
HOST
HS HUB
Non-Split
Transfers for
HS device
HS Device LS Device FS Device
Split Transfers
For FS/LS device
USB 2.0 STREET TALK
29
In High Speed Split Transaction
SSPLIT
IN TOKEN
1. Start Split
(Frame = a.x)
DATA0
ACK
IN TOKEN
2. Full/Low Speed
Frame = (a.x or a.(x+1))
CSPLIT
IN TOKEN
DATA0
3. Complete Split
Frame > a.(x+1)
Host Hub FS/LS
Device
High Speed Bus Full/Low Speed Bus
USB 2.0 STREET TALK
30
Out High Speed Split Transaction
OUT TOKEN
DATA0
ACK
2. Full/Low Speed
Frame = a.x or a.(x+1)
CSPLIT
OUT TOKEN
ACK
3. Complete Split
Frame > a.(x+1)
Host Hub FS/LS
Device
High Speed Bus Full/Low Speed Bus
1. Start Split
Frame = a.x

SSPLIT
OUT TOKEN
DATA0
USB 2.0 STREET TALK
31
Link Power Management
New Low Power state L1 Sleep state
Suspend state defined as L2 state
Current Suspend/Resume timings are inadequate for
current/future mobile platforms
Defined new PID: EXT and new SubPID tokens


L1(Sleep) L2(Suspend)
Entry Explicit LPM transaction Implicit via. 3ms of inactivity
Exit Device or host initiated
resume
Device or host initiated resume

Latencies Entry ~10 us
Exit ~ 70us 1ms
Entry ~ 3 ms
Exit > 30 ms
Power
consumption
Application/Implementati
on specific
Limited to <= 500uA
USB 2.0 STREET TALK
32
Device Speed Detection - LS
Initialize System/
Controller registers
Device Connect
D+ Low; D- High
Inform CPU
About Device Connect
Check Port Status
Register (D- is HIGH)
Power VBUS
Stop Reset to
USB Device
Issue Reset to
USB Device
End of Host Reset
SW
Confirm
s
LS
device
HS
HOST
LS
DEVICE
SW
Start Host Reset
USB 2.0 STREET TALK
33
Device Speed Detection - HS
Device Connect
D+ High; D- Low
Inform CPU
About Device Connect
Check Port Status
Register (D+ is HIGH)
Stop Reset to
USB Device
Issue Reset to
USB Device
End of Host Reset
SW
Confirm
s
HS or
FS
device
Initialize System/
Controller registers
Power VBUS
HS
HOST
HS
DEVICE
SW
Start Host Reset
Device
Chirp
Check Port Status
Register (HS)
Host
Chirp
Host confirms
HS device
SW
Confirm
s
HS
device
USB 2.0 STREET TALK
34
Device Speed Detection FS
Stop Reset to
USB Device
Initialize System/
Controller registers
Device Connect
D+ High; D- Low
Inform CPU
About Device Connect
Check Port Status
Register (D+ is HIGH)
Power VBUS
Issue Reset to
USB Device
SW
Confirm
s
HS or
FS
device
HS
HOST
FS
DEVICE
SW
Start Host Reset
Check Port Status
Register (FS)
SW
Confirm
s
FS
device
End of Host Reset
Host confirms
FS device
(absence of
Device chirp)
USB 2.0 STREET TALK
35
Device Speed Detection FS Host/HS Device
Device Connect
D+ High; D- Low
Inform CPU
About Device Connect
Check Port Status
Register (D+ is HIGH)
Stop Reset to
USB Device
Issue Reset to
USB Device
End of Host Reset
SW
Confirm
s
FS
device
Initialize System/
Controller registers
Power VBUS
FS
HOST
HS
DEVICE
SW
Start Host Reset
Device
Chirp
Check Port Status
Register (FS)
Host does not
Send Host Chirp
SW
Confirm
s
FS
device
Device
Switche
s to
FS
NAVEEN KANUMURI
The USB On-The-
Go 1.0 Supplement
to USB2.0
Specification
The OTG specification
is a supplement to the
existing USB2.0
specification. It adds
the capability for USB
devices to directly talk
to each other
USB 2.0 STREET TALK
37
OTG Specification
USB On-The-Go Supplement to USB2.0
Supports all speed ratings
Low Speed (1.5 Mbps)
Full Speed (12 Mbps)
High Speed (480Mbps)
Extends device only products to include host capability
Defines special signalling scheme
Host Negotiation Protocol (HNP)
Session Request Protocol (SRP)
Defines a new mini-connector
Mini-A, Mini-B
New Connector Pin: ID
Reduced Power Consumption
8 mA compared to 500 mA for standard Host
USB 2.0 STREET TALK
38
Why USB On-The-Go
Need for connectivity of
portable devices
One standard connectivity for
different application for portable
devices
Broadens the USB Market
Low Cost Connectivity
Mixed peripheral support
low to high speed
On-The-Go makes USB less PC
centric.
USB 2.0 STREET TALK
39
Example OTG Application
Smart Phone wants to support Active Sync capability
when connected to PC
PC will act as a HOST
Smart Phone will act as a DEVICE

Smart Phone needs to be connected with Digital
Camera OR Keyboard
Smart Phone will act as a HOST
Camera/Keyboard will act as a DEVICE
USB 2.0 STREET TALK
40
Applications for On-The-Go
USB 2.0 STREET TALK
41
OTG USB System Overview
Topology
Direct Connection
2 devices maximum

Bus Transactions
480Mbps, 12Mbps,
1.5Mbps

Transaction Types
All of existing 2.0 types
Host Negotiation Protocol
Session Request Protocol

Hubs not allowed

USB 2.0 STREET TALK
42
Device Types
Two types of devices: A-device, B-device
Device type decided based on cable insertion
OTG Cable has Mini-A on one side and a Mini-B connector on
the other side
A-device
Decided if Mini-A plug is inserted
ID is shorted, detected by OTG Controller
Acts as USB Host
Supplies VBUS
Must source at least 8mA
B-device
Decided if Mini-B plug is inserted
ID pin is floating, detected by OTG Controller
Acts as a USB peripheral
May consume upto 8mA if bus powered

USB 2.0 STREET TALK
43
Session Request Protocol
Allows the OTG Host to turn off the USB bus to save
power
Slave device is able to request a new session using
one of 2 methods
OTG Host can also start a session by switching power
back on
USB 2.0 STREET TALK
44
SRP Protocol Description
Data Line Pulsing
Slave waits for USB bus to become inactive
(voltages fall below pre-determined limits)
Device pulls D+ line to a high level
Master device detects this and switches on USB power
USB 2.0 STREET TALK
45
SRP Protocol Description
VBUS Pulsing
Works in a similar fashion to Data Line Pulsing but uses
USB bus power line
Device waits for bus voltages to fall below pre-defined
thresholds
Device drives some current into VBUS on the USB cable
This current is at a predefined level to cause a specific
voltage on VBUS which will not damage hosts not VBUS
pulsing capable
Host detects active VBUS and switches power on
USB 2.0 STREET TALK
46
Host Negotiation Protocol
Effectively turns cable around
Two dual-role devices
Mini-A to mini-B cable
Default slave (mini-B end) wants to start conversation
USB 2.0 STREET TALK
47
HNP Operation
Host enables HNP in OTG slave with Set Feature
Device disconnects
Master asserts pull-up
Device issues reset and SOF
Original device is now Master
New host enumerates and begins activity
When finished the new host suspends the bus
On Suspend, original host drops pull-up and
resumes Host role
HOST
Device
Device
HOST
HOST
Device
HNP
Suspend
A-Device
B-Device
USB 2.0 STREET TALK
48
Target Peripheral List
To cut down on software overhead OTG devices
use trimmed software stacks
These support a range of specific devices rather
than device classes
Allows for a leaner software package
Supported list may be upgradeable via software
update etc.

Вам также может понравиться