Introduction to the USB
USB (Universal Serial Bus) is as its name suggests, based on serial type architecture. However, it is an input-output interface much quicker than standard serial ports. Serial architecture was used for this type of port for two main reasons:
- Serial architecture gives the user a much higher clock rate than a parallel interface because a parallel interface does not support too high frequencies (in a high speed architecture, bits circulating on each wire arrive with lag, causing errors);
- serial cables are much cheaper than parallel cables.
So, from 1995, the USB standard has been developed for connecting a wide range of devices.
The USB 1.0 standard offers two modes of communication:
- 12 Mb/s in high speed mode,
- 1.5 Mb/s in low speed.
The USB 1.1 standard provides several clarifications for USB device manufacturers but does not change anything in the speed. USB 1.1 certified devices carry the following logo:
The USB 2.0 standard makes it possible to obtain speeds which can reach 480 Mbit/s/ USB 2.0 certified devices carry the following logo:
If there is no logo, the best way of determining if something is a low or high speed USB is to consult the product documentation insofar as the connectors are the same.
Compatibility between USB 1.0, 1.1 and 2.0 is assured. However, the use of a USB 2.0 device in a low speed USB port (i.e. 1.0 or 1.1) will limit the speed to 12Mbit/s maximum. Furthermore, the operating system is likely to display a message explaining that the speed will be restricted.
Types of connectors
There are two types of USB connectors:
- Connectors known as type A, where the shape is rectangular and generally used for less bandwidth intensive devices (keyboard, mouse, webcam, etc.);
- Connectors known as type B, where the shape is square and mainly used for high speed devices (external hard disks, etc.);
- Power supply +5V (VBUS) 100mA maximum
- Data (D-)
- Data (D+)
- Mass (GND)
Operation of the USB
One characteristic of USB architecture is that it can supply electricity to devices to which it connects, with a limit of 15 W maximum per device. To do so, it uses a cable made up of four wires (the GND mass, the BUS supply and two data wires called D- and D+).
The USB standard allows devices to be chained by using a bus or star topology. So, devices can either be connected one to another or branched.
Branching is done using boxes called "hubs" comprising of a single input and several outputs. Some are active (supplying electric energy), others passive (power supplied by the computer).
Communication between the host (computer) and devices is carried out according to a protocol
(communication language) based on the token ring principle. This means that bandwidth is temporarily shared between all connected devices. The host (computer) issues a signal to begin the sequence every millisecond (ms), the time interval during which it will simultaneously give each device the opportunity to "speak". When the host wants to communicate with a device, it transmits a token (a data packet, containing the address of the device coded over 7 bits) designating a device, so it is the host that decides to "talk" with the devices. If the device recognises its address in the token, it sends a data packet (between 8 and 255 bytes) in response, if not it passes the packet to the other connected devices. Data is exchanged in this way is coded according to NRZI coding.
Since the address is coded over 7 bits, 128 devices (2^7) can simultaneously be connected to a port of this type. In reality, it is advisable to reduce this number to 127 because the 0 address is a reserved address. (see later).
Due to the maximum length of the cable between two devices of 5 metres and a maximum number of 5 hubs (supplied), it is possible to create a chain 25 meters in length.
USB ports support Hot plug and play. So, devices can be connected without turning off the computer (hot plug). When a device is connected to the host it detects the addition of a new item thanks to a change in the tension between the D+ and D- wires. At this time, the computer sends an initialization signal to the device for 10ms, then it supplies the current using the GND and VBUS wires (up to 100mA). The device is then supplied with electric current and temporarily takes over the default address (0 address). The following stage consists of supplying it with its definitive address (this is the listing procedure). To do so, the computer interrogates devices already connected to know their addresses and allocates a new one, which identifies it by return. The host, having all the necessary characteristics is then able to load the appropriate driver.
The full specifications for the USB standard can be downloaded from the website USB Implementers Forum: