Universal Serial Bus (USB)
Universal Serial Bus (USB)
Submitted to :
INTRODUCTION TO USB
USB:- USB stands for Universal Serial Bus . It is designed to overcome from various drawbacks of serial and parallel communication interface. Serial And Parallel Communication have following drawbacks: Limited Resources of I/O lines,DMA locations and IRQ. Multiple Interrupt Handling Problems I/O Address Accessing Problems due to less address accessing by ISA lines. Non Shareable Interface between Serial and Parallel communicating devices.
USB 1.0 :-
USB2.0 :- The Host controller for USB2.0 has compatibility with USB1.0 Device controllers. Speed : 480Mb/s(Effective Through Put upto 35MB/s) USB3.0 :- It support Speed Upto 5Gbit/s
There are few terms that are need to be understand while designing or working on the USB protocol. USB Host :- It is the BUS master which is responsible for all the transaction. A USB host may implement multiple host controllers and each host controller may provide one or more USB ports. Up to 127 devices, including hub devices if present, may be connected to a single host controller. USB Device:-It is acting as Slave over the communicating line .It is the electrical part that has been accessed by HOST Controller for performing I/O transactions.
USB On-The-Go(OTG):-It is the USB ,whose controller can be either work as Host controller and can be work as Device controller depending upon the need in the physical world.
Examples :USB HOST :- Computer ,Laptops USB Device :- Pendrive , Mouse , Printer ,Webcam etc. USB OTG :- Smart Mobile Phones , Tablets etc.
USB devices are of two types composite and compound . If one device having multiple endpoints that device falls under composite device category e.g webcam along with mice. If a device have only one end point that USB device comes under compound category. USB devices communicates on the basis of PIPEs i.e logical channels. The Pipes are Further divided in two categories (1) Message Pipe:- It is directional Communication like Host controller is sending few commands to USB device and waiting for response . (2) Stream Pipe:- Uni-directions data transfer in either of the upstream or downstream.
USB device support different type of stream based data transfer :(1) Isochronous:- The devices that comes under this category are very critical to data rate with possible little data lose e.g. Audio and video Players (2) Interrupt transfer :-A device that required granted quick response without any data lose and without any delay e.g:- Mouse, Keyboard (3) Bulk Data transfer:- large transfers using all remaining available bandwidth, but with no guarantees on bandwidth or file transfer. E.g Pen drives,Flahmemory.
Device Controller
End Point-1
End Point-2
End Point-32
TOPOLOGY CONT
The transaction is carried out by the client software installed in the HOST computer. This S/W will Ask host controller to fetch and execute the transaction list and frame of 1ms(USB1.0) or Micro frame of 125us from Memory location. USB Bus Driver :- It knows the Characteristics of USB device and how to communicate it with . USB Characteristics are know to USB bus driver at the time of Driver installation or from inbuilt Device classes addresses. Host Controller Driver:- This will schedules then transaction to be broadcasted over the physical channel to each. Each Device will receive the transaction descriptor having following fields:
(1) Device Address (Also contains Endpoint Addr.) (2) Type of Data transfer (3) Speed of Data transfer (4) Buffer address from where data will be transacted with device (5) Transfer Size USB Device :-It has individual registers and ports that are individually accessed by device drivers called endpoints . Each Device has standard descriptors at endpoint 0 that will be used by USB system software and help top detect device and how device is intended to accessed.
White (gold*)
Green Black (blue*)
ID
None
Permits distinction of host connection from slave connection * host: connected to Signal ground * slave: not connected
Signal ground
GND
Black
IMPORTANT POINTS
We can Connect upto 127 devices with one HOST controller A USB device can have upto 32 endoints we can connect upto 4 HUB to one root hub because of power limitation.
USB OTG:
USB On-The-Go introduces the concept that a device can perform both the master and slave roles, and so subtly changes the terminology. With OTG, a device can be either a host when acting as the link master, or a peripheral when acting as the link slave. The choice of whether to be host or peripheral is handled entirely by which end of the cable the device is plugged into. The device connected to the "A" end of the cable at start-up, known as the "A-device", acts as the default host, while the "B" end acts as the default peripheral, known as the "B-device". After initial startup, setup for the bus operates as it does with the normal USB standard, with the A-device setting up the B-device and managing all communications. However, when that same A-device is plugged into another USB system, or a dedicated host becomes available, it may become a slave.
USB On-The-Go does not preclude using a USB hub, but it describes host/peripheral role swapping only for the case of a one-to-one connection where two OTG devices are directly connected. Role swapping does not work through a standard hub, as one device will act as the host and the other as the peripheral until they are disconnected
The USB On-The-Go and Embedded Host Supplement to the USB 2.0 specification introduced three new protocols, Attach Detection Protocol (ADP), Session Request Protocol (SRP) and Host Negotiation Protocol (HNP).