Sie sind auf Seite 1von 30

UNIVERSAL SERIAL BUS

1
Overview

 Introduction
 Components
 Protocol
 Icons
 Developments
 USB OTG

2
What Is USB?

1. Invented & standardized – 1995


 U – universal
 S – serial
 B – bus
5. 127 Devices ?
6. Data transmission using packets.

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

 Host controller (m) and device controller (s)


 Hub is optional
 Five “basic” components
Cables and Connectors
Power
Electrical Signaling
Protocol
Device Framework
Standard commands
Standard descriptions
5
Connectors
3“standard” plugs (not including
OTG mini-A)
‘A’ plug leads upstream to host
‘B’ or ‘mini-B’ plug goes to device
“captive”cable -- device end of cable
uses a “vendor-specific connect
method”: hard-wired or special plug

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

 Alldevices should have ENDP = 0


 Each buffer is of 8 bit length.

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

Setup , IN, OUT , SOF


SYNC PID ADDR ENDP CRC5 EOP

SYNC – START OF PACKET (8)


PID – PACKET ID (8)
ADDR – ADDRESS(7)
ENDP – ENDPOINT(4)
CRC5 – CHECKSUM(5) X^5 + X^2 + 1
EOP – END OF PACKET(D+ , D- both zero)
15
Token packets
 Setup
 Device configuration
 Device descriptors etc

 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

PID DATA EOP


SYNC CRC1
 DATA – PAYLOAD
6
 CRC16 – CHECKSUM (16) X^16 + X^15 +
X^2 + 1.
17
CRC

o WHY CRC5 – Token packets , CRC16 – Data packets ?


 size of packets

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

requires intervention from the host.


• Transmission is in opposite direction of that of data
packets.
SYNC PID EOP

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 ?

 Supplement to USB 2 specification


 Gives dual role capability to
increasingly intelligent platforms , on
the same port
 Result is “point-point” USB from
users perspective.
 Supports 12 Mbps , 1.5 Mbps

480 Mbps (optional)


26
What changes does USB
OTG require?
 Reduced connector size.
 Power consumption is less.
 Adds protocol for dynamic switching
between host and device (HNP).
 Session request protocol
 USB power can switched on/off on
discretion of device A

27
OTG Dual-Role Device

 has a single mini-AB receptacle


Is A-device (host) when mini-A plug
inserted
Is B-device (device) when mini-B plug
inserted
 operates at Full-speed
 may operate at High-Speed
 may support one or more hubs (as an
A-device)
28
COMPARISON

USB OTG product USB Host in PC


-Must source 8mA -Sources 500mA on
Vbus
min on Vbus
-May or may not be able to -Supports device
which has
load more drivers drivers.
-Always has
mechanism to
load more
drivers. 29

-PCI not present -Standardized PCI


For more information

 Visit
 www.usb.org
 www.usb.org/developers/onthego
 http://www.howstuffworks.com/
 http://www.trenz-electronic.de/down/dwdten.ht

30

Das könnte Ihnen auch gefallen