Tuesday, June 18, 2013

USB (Universal Serial Bus): An Overview



While Communication in USB we consider three parts-
1.       a) Host which can be a Computer / PC/ laptops
2.       b) USB cable and connector
3.       c) Peripheral devices eg. Keyboardsmouse, audio player etc

USB systems consist of a personal computer (PC) known as host and multiple peripheral devices like mouse, keyboard, and audio system. The host itself contains two components, the host controller and the root hub. A host controller is a hardware component that is contained in a host computer. The Host controller converts the data in the language understandable to the OPERATING SYSTEM and also manages communication on the bus. The USB host controller has an embedded hub called the root hub. A hub is a common connection point that allows multiple devices to connect in the network. A hub contains multiple portsThe root hub connects the host controller(s) to the peripheral device and acts as the first interface layer to the USB in a system. The ports that are visible at the system's back panel are the ports of the root hub.  These ports are part of the root hub and in turn can be connected to external hub thereby increasing the number of USB devices which can be connected to host. An external hub can be used to extend the connections to the maximum of 127 devices.
Whenever a USB device is connected or disconnected it is first detected at the root hub which in turns passes information to the host controller. USB is a half duplex protocol where all data is passed via a two wire interface called D+ (D plus) and D- (D minus).

The host is responsible for the following tasks:
1.       1.Detect attachment and removal of USB devices
2.       2.Provide and manage power to attached devices
3.       3.Monitor activity on the bus and initiate the process of enumeration
4.       4.Manage data flow between host and devices.

               
When we discuss data transfer across the USB we always use the vantage point of the host for reference. For example, if there is an IN transfer that means the host is going to receive the data. An OUT transfer means the host is going to transmit data
USB cable and connectors
From an outer overview, USB has two components: cables and connectors. These connectors connect devices to a host. A USB cable consists of multiple components that are shielded by an insulating jacket. Underneath the jacket is an outer shield that contains a copper braid. Inside the outer shield are multiple wires: a copper drain wire which is a twisted pair of cable, a VBUS wire (red) and a ground wire (black). An inner shield made of aluminum contains a twisted pair of data wires.



There is a D+ wire (green) and a D- wire (white). In full-speed and high-speed devices, the maximum cable length is 5-meters. To increase the distance between the host and a device, you must use a series of hubs and 5-meter cables. While USB extension cables exist in the market, using them to exceed 5 meters is against the USB specification. Low-speed devices have slightly different specifications. Their cable length is limited to 3 meters and low-speed cables are not required to be a twisted pair as USB Twisted Pair Data Wires. The voltage bus gives a constant 4.40 v – 5.25v supply to all devices and the data lines supplies up to 3.3v. The reason for using the differential D+ and D- signal is for rejecting common-mode noise. If noise becomes coupled into the cable, it will normally be present on all wires in the cable. With the use of a differential amplifier in the USB hardware internal to the host and device, the common mode noise can be rejected.
Now we move ahead and learn more about the connectors. The figure below shows the various types of connectors.


There are many different types of USB ports and connectors available. The upstream connection always uses a Type A port and connector, while the device uses Type B ports and connectors. Initially, the USB specification included only the larger Type A and Type B connectors for devices but later included the Mini and Micro connections. These Mini and Micro connectors were initially developed for USB On-the-Go which is a USB specification that allows devices that would normally act as slaves to become hosts but later they were adopted in devices as they had smaller size as compared to type B.
1.       Type A- It is used for connecting the cable to the host device also known as upstream end. They are flat in shape and have four connections in line.
2.       Type B- It is used to connect cable to peripheral device and also known as downstream end. They are square in shape and have two connections on both sides of centre.


Micro A and Micro B type connector’s description table.