From Novice To a Masterpiece.
Universal Serial Bus
Introduction
The Universal Serial Bus or the short and sweet USB is but one of the latest technologies to engulf the data transfer arena. It is a technology which has redefined the speed of communication vis-a-vis the computer and its peripherals.
The area which was once completely conquered by the serial and parallel and in some cases, the modem port, is now the property of this blitzkrieg beauty. The use of a USB device is not only the speed but also the connectivity. What I mean to say is - on one hand, this uses Plug n Play (PnP) technology, and on the other, plugging it in is child's play. Jinxed?? Don't be. Read on.
The Protocol
The USB protocol supports, as the name suggests, serial transfer of data, from a host computer, viz the master of the data bus, to a USB device, obviously the slave. The USB device can be connected to the host either directly or through a hub connected to the host. The hub, on the other hand is connected directly or thru another hub and so on. Getting the picture? That's better. Proceed.
There are two modes of signalling
- Data transfer at a whopping 12 Mbps.
- Data transfer at a decent 1.5 Mbps.
These are certainly mind boggling figures. But the USP of USB is the PnP capability. What I mean by Plug n Play ( in fact that's what everyone means ) is that you don't need to install any drivers whatsoever. This is not the case with the other ports where you needed a driver to be installed in order to use your mouse(serial) or a printer (parallel). All you need to do to use a USB device is - Connect it.
The USB data bus is always kept active. The host sends data in the form of packets. It sends Start Of Frame(SOF) packets every 1ms thru the bus. There are 3 types of packets:
- Token Packet
- Data Packet
- Handshake Packet
When a device needs to connect, the host sends the Token Packet which contains the address. The device identifies its address from the token packet and it sends or receives data packets depending on the direction in the token packet. Once the data packet in sent/received by the Host a handshake packet is sent as a confirmation of the success of the transaction.
The Host
USB hosts are nothing but the main or master devices in the daisy chain of USB devices, which are built around the USB chipsets and motherboards. If your computer has USB capability then it must have a USB port. This port is either provided on the motherboard itself or else a separate card with this port needs to be fixed on one of the slots on the board. Normal rules hold good here too, in the sense that, there can be only one host in a chain of such devices. It is like a company with a public offer where the BUS is the share and the devices, the share holders. Each one of the devices has equal weightage irrespective of its size and functionality. Just as the company is answerable to the public the host answers the queries of the other devices and maintains a log of all the events.
USB Serial Interface Engine is incorporated as part of the USB Host Controller(HC) on the motherboard. The three parts of the USB software are....
- HC Driver that links other HC implementations with the rest of the USB software structure. In other words the driver.
- The USB system software that is an intermediary between the HC and the client software.
- Client software thatz required for the client to communicate with the USB device attached.
The Paraphernalia
The peripherals are of two types:
- Hubs
- Devices or Functions
Depending on the number of devices that are required, hubs are used. Hubs consist of two parts:
- Hub Controller
- Repeater
It basically does the job of providing more ports for connection which in turn helps in expansion. Aha! Me forgot to tellya one major thing - USB can support upto 127 devices in a daisy chain and do that without the reduction in speed !!! Pinch Yourself!
The hub, basically consists of on upstream connector and more than one downstream ports. Bheja Fried? What happens is: When it is required to connect five devices to a host and all you have is one port on the host, then one hub could be connected which has one upstream connector (and this is what goes to the port on the PC or host) and five downstream ports to which we can connect the five devices. Thus the need to get a separate card with more ports is eliminated. This not only reduces the cost but also does the job without a compromise on speed.
Basically the USB devices consist of the following components:
- A Serial Interface Engine (SIE), implemented in silicon. It is responsible for the transmission and reception of USB structured data.
- A hardware and firmware combination responsible for data transfer between the SIE and the device endpoints and their corresponding pipes.
- The third element corresponds to the actual capability or functionality that the device brings to the system (e.g., keyboard functionality).
What happens if a device is connected to an already active network? Under such circumstances the device needs to wait for a confirmation from the host. This confirmation is received as a token in the bus. The token is sent by the host. If the device requesting service sees a match of its address in the token it connects. Golden Handshake!!!
Hot Attach and Hot Detach
Sounds hot!? It is. Well this capability of the USB is wonderful in the sense that you don't need to restart each time a device is connected to the host. When there's a stranger the host is notified and the system software starts its interrogation with the foreigner, gets his details and later configures the device. This is called as Bus Enumeration. The system software also provides the necessary device drivers for the fresher to function properly. That's what I call changing a Dumbo computer to a Sizzling Macintosh!!!! It is for this reason that I included this as a separate part and did not include it in the PnP section.
The Cable
The cable gets a special mention here because of its anatomy. It consists of 4 wires. 2 wires D+ and D- perform the data transfer while the other two are V-bus and GND viz for power and ground respectively. The D wires use differential signalling for data transmission. For the 1.5Mbps speeds Unshielded Twisted Pair(UTP) wires are used which are cheap in both respects. For 12Mbps however, Shielded Twisted Pair(STP) wires are used. Not surprisingly, they do a jet!
Data Transfer
Data transfer between the host and the device is either unidirectional or bidirectional. Four types of data transfers are:
- Control
- Interrupt
- Isochronous
- Bulk
A Final Note
USB is fast becoming a hot entity. Though there are not many USB devices right now, the trend won't be the same half a year from now. Thus if you are planning to go in for a new computer you better get yourself atleast one USB port. Later, as I said it is possible to easily expand this. If you are the "Sheer Indifference" guy and
want to go in for an iMac or a PowerMac, then you can rest assured; because what you get is not only USB but aso FireWire (IEEE 1394) which is nothing short of a Bonus.
Whatever is your choice, let USB have some place in your mind!
Home
p Copyrights
Reserved. Sandeep Corporation Ltd., India. SanCorps
& Sanonlines
are trademarks of SanCorp Ltd.