Download presentation
Presentation is loading. Please wait.
Published byWillis Kennedy Modified over 9 years ago
1
USB: UNIVERSAL SERIAL BUS Joe Kaewbaidhoon Alex Motalleb Vishal Joshi Prepared for EECS 373 University of Michigan, Ann Arbor 1
2
2 What do we use to connect a device to a computer? http://www.prlog.org/11492850-6e23d- dellcomputer.jpg http://best-external-hard- drives.ecoustics.com/d/f/USB-3.0
3
USB The most widely used hardware interface for connecting peripheral devices to a computer. http://www.gizmag.com/standard-micro-usb-charger-europe/12108/
4
History Developed in the mid 1990’s by Compaq, DEC, IBM, Intel, Microsoft, NEC, Nortel Purpose: Reduce cabling Reduce type of ports Simplifying software configuration More efficient transfers, higher data rates Versions: 1.0, 2.0, and 3.0 4
5
5 How do we physically connect a device?
6
Connectors Single master, up to 127 slaves Type A (faces upstream) The connector found on host and hubs Type B (faces downstream) The connector found on slave devices miniA, miniB, and several other types used for smaller devices 6 http://www.beyondlogic.org/usbnutshell/usb2.shtml
7
Pins/wires 4 pins Ground V cc : power the devices (5V output from master), note that some devices can draw power from 2 USB ports 2 data lines (D + and D - ) Twisted Pair Differential Transmission: If D + - D - > 200 mV, send ‘1’. If D - - D + > 200 mV, send ‘0’. Polarity switches with speed 7 http://en.wikipedia.org/wiki/Usb
8
J-K state 8 Polarity switches with speed J and K are logical states Hi-speed differential signal Low-speed differential signal J state10 K state01
9
9 Once connected, how does the hardware communicate?
10
Protocol Terms Hub: Connects slaves to host (master) Endpoint: a logical entity, found on a device. A USB connection may have up to 32 endpoints (16 for master and 16 for slave) in one connections Pipes: connection from one endpoint to another 10 http://www.gadgetrivia.com/targus_usb_2.0_d vd-rom/cd-rw_slim_external_combo_drive
11
Endpoint Example 11 http://www.beyondlogic.org/usbnutshell/usb3.shtml
12
Hardware Initialization 12 Hub port has status bits plugged in, status bit = 1 Idle = 0 Hub automatically updates when something plugs in Host polls the status bits If 1, initializes the hardware and software protocol
13
Powering a Device with V cc Devices can be powered using the V bus (V cc ) line Functions divided into three types Low-power bus powered function May use up to one unit load (100 mA) High-power bus powered function May use up to 5 unit loads (500 mA) after configuration Self-powered function May use up to one unit load Rest of the power supplied by external source 13
14
Transfer Speeds on D + and D - Low speed = 10-100 KB/s Used for Human Interactive devices (ex. keyboard, mouse, etc) Full speed = 500 KB/s – 10 MB/s Used for audio and compressed video (ex. Microphone) High speed = 25-400 MB/s Used for video and storage (ex. Digital camera) USB 1.0 USB 2.0 14
15
Drivers Once the connector is plugged in, the host detects and interrogates it Loads appropriate driver based on PID/VID (Product ID/Vendor ID) combination VID provided by USB Implementer's forum for a fee 15
16
16 Once connected and synchronized, how is the software going to facilitate communication?
17
Hierarchy of Data Transfers 17
18
Hierarchy of Data Transfers 18
19
Transfers Control: used for command and status operations Most common type of transfer Interrupt: a polling transfer which checks devices for interrupts Isochronous: continuous, periodic transfers Generally used for audio or video streaming Bulk: used for large bursts of data Example: print-job, scanner image 19
20
Hierarchy of Data Transfers 20
21
Stages Typical stage involves three types of packets Token: Describes what follows, read/write, address of device, designated endpoint Data (optional): Carries the payload Low speed – 8 bytes Full speed – 1023 bytes High speed – 1024 bytes Status: reports whether data/token was received, if endpoint stalled 21
22
Control Transfer: Setup Stage Setup Stage: 3 packets – Token, Data0, Ack 22 http://www.beyondlogic.org/usbnutshell/usb4.shtml
23
Control Transfer: Data Stage Data Stage: IN or OUT depending on direction of transfer 23 http://www.beyondlogic.org/usbnutshell/usb4.shtml
24
Control Transfer: Status Stage Status Stage: IN or OUT depending on direction of transfer 24 http://www.beyondlogic.org/usbnutshell/usb4.shtml
25
Hierarchy of Data Transfers 25
26
Packet Types Token Packets In: Host requests read Out: Host requests write Setup: Used to begin control transfers Data Packets Data0 Data1 Handshake Packets ACK: Successfully received NAK: Failed to receive (also used during interrupts) STALL: Host must intervene 26 http://www.beyondlogic.org/usbnutshell/usb3.shtml
27
Hierarchy of Data Transfers 27
28
Packet Fields Sync: 8-32 bits used to synchronize host clock with device clock Packet ID (PID): defines the type of packet being sent Sent as 8 bits -> ADDR: specifies which device the packet is being sent to 7 bits for addressing to 127 slaves Address 0 is invalid 28 http://www.beyondlogic.org/usbnut shell/usb3.shtml
29
More Packet Fields ENDP: defines the target endpoint 4 bits for 16 possible endpoints Endpoint 0 must exist CRC: Cyclic Redundancy Checks 5 bits within token 16 bits within data EOP: End of packet 29
30
Data Encoding Uses NRZI (Non Return to Zero Inverted) Transition -> 0 No transition -> 1 30 Adapted from http://en.wikipedia.org/wiki/File:NRZI_example.pnghttp://en.wikipedia.org/wiki/File:NRZI_example.png
31
Bit Stuffing 31 Bit stuffing after 6 th consecutive ‘1’ http://www.eetimes.com/design/embedded/4023950/USB-Debug-Tips
32
Questions? 32
33
References http://www.nti1.com/usb-prots.html http://www.nti1.com/usb-prots.html http://www.usb.org/developers/docs/ http://www.usb.org/developers/docs/ http://www.beyondlogic.org/usbnutshell/usb1.htm http://www.beyondlogic.org/usbnutshell/usb1.htm 33
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.