What is Universal Serial Bus

USB (Universal Serial Bus or universal serial bus) has been designed for four years, from 1994 to 1998, by several companies: Philips, NEC, Hewlett-Packard, Microsoft, Intel, Compaq, and Lucent. Currently, it equips all the newer computers. Each current device can be used on a USB port. The USB port has replaced serial ports and parallel. The USB has certain advantages, especially a great ease of extension and use.

What is Universal Serial Bus 1

USB supports “plug and play” (automatic detection of new devices), and the transmission of voice, sound and video compressed real-time. One of the special features of USB is that it supports the “Hot Plug And Play”. This means that a USB device can be connected to the computer at any time. It is later configured automatically, without restarting the computer. This is possible if the operating system allows.
USB possible topologies are star, bus, or tree.

Connect devices

There are many USB ports built into the motherboard. To have even more ports, we can use a USB controller. It comes in the form of an equipped with USB ports, expansion card to be inserted in a PCI or PCI – E connectors. As a general rule, a USB controller card has four or five ports. Once installed, it is possible to connect USB devices in any order. We say when the devices are connected in “Star”. The term comes from the fact that all the devices are connected on a common card. If we want to increase sharply the number of device to use, we need to connect a USB HUB on one or more ports of the controller. A HUB is an element used to “multiply” the number of ports available. To do this, we place at its entrance a cable linking it to the controller. The port is then multiplied on the HUB. The image below shows a USB HUB.

What is Universal Serial Bus 2

USB hub

Power supply of the USB HUB

A device can be powered either directly through the USB port, or, more rarely, by the sector (using a transformer).
The USB HUB can be fed them also in two different ways. Some have a supply for each port, and require a transformer connected to the electric network. They are capable of powering the device directly using the current from the USB HUB. The other type of power supply use only the current delivered by the controller. This type of HUB is generally unable to power devices not connected to the electric network. There are actually three types of power supplies that fit the USB HUB:

  • Powered USB Hubs“: 500mA on all ports
  • “Low Power, powered USB Hub functions”: on each port 100mA
  • “High power, powered USB Hub functions”: 500mA on each port

Cables and pinouts

Controllers and HUBs are equipped with several so-called connectors of type “A”. On devices, we find so-called “B” type connectors. The cable consists of four wires. Two of them are used to convey data and his twisted to avoid external disturbance. The other two wires provide the current needed. One of them is the potential + 5V and the second is the mass. The faster transmission of data is important, the cable is sensitive to external electromagnetic disturbances.
The diagram below shows the connections of ports and USB cables. The D + and D – pins are used to transfer data. Pin D + transmits the data packets, and pin – D contains the reverse logic signal. This serves to control the transmitted signal and to ensure optimal transmission security. The diagram below shows the pins used for transmissions of data with the USB port.
USB pinout

1: Voltage + 5V (supply)
2: D-: reverse logic data (error checking)
3: D +: Data Transmission
4: Mass

USB Hub Device

Mode of transmission

The transmission of data by the USB works on the principle of the token (token ring) ring. The principle of this mode of communication is based on the fact that devices are questioned one after another, in very small time interval. Thus, when the computer needs to transmit data to one of them, it emits a token, which is a data packet containing the address of the desired device. It receives the data through this address. Of course, other devices are not affected, because they all have a different address.

USB can operate in three different modes. It’s low-speed (low speed, 1.5 MB/s), full speed (full speed, 12 Mbps) and high speed (high speed 480 MB/s) modes. This is independent of the used version. So, a device that requires a low flow (keyboard or mouse for example) work with a flow rate of 1.5 MB/s even though it works with USB 2.0. Conversely, an audio or video device will be operated in mode high speed. This is only set according to the needs of the device.

Note that all data exchanges are done using the NRZI encoding, deriving from the NRZ coding.

What is Universal Serial Bus 3

Integration of new devices

When a new device is plugged in, it applies a voltage of HIGH level on the pin D + or D-. If the HIGH level (HIGH voltage) is located on the contact D +, it is a device operating in mode full speed. If the HIGH level is applied to the pin-D, the device will run in mode low speed (low speed). Devices operating in mode high speed (high speed) give a level of HIGH voltage on pin D +. Later, the computer transmits a packet making them operate in high speed.
When a new device is connected while the computer is turned on, it receives a so-called generic address address 0. The computer queries all devices for each address. It then assigns a free address to the new device.
To assign an address to the device, the computer sends a query called SET_ADRESS, followed of a package IN. The new device responds by sending a packet DATA generic. The computer then sends a package called GET_DESCRIPTOR, answered by transmitting its manufacturer, model, type of device, etc, in a package IN the device.