USB - How a Computer Works (2015)

How a Computer Works (2015)

22. USB

USB_CONN2.jpg

Universal System Bus

mb_3d_parallel_serial.jpg

Although some peripherals are connected to the serial and parallel ports where fitted. The main interface is the universal system bus (USB). This allows more peripherals to be connected to the computer than the old serial or parallel ports would allow.

Data can potentially be transferred at much faster rates than with serial or parallel ports.

A serial port sends only 100 kilobits a second, a parallel port about 2.5Mbps. USB 12Mbps and USB 2.0 transfers data at 480Mbps. This books figures are based on the standard USB transfer rates.

I/O Controller Hub

mb_sm_io.jpg

On the motherboard sits the I/O controller hub, this one chip is the main hub for controlling input/output communications for the computer.

On the motherboard four USB ports are connected to the I/O controller hub. USB ports/hubs can be found on monitors or separate hubs that allow more peripherals to be connected.

USB Plug

USB_CONN2.jpg

Connected to a USB port is a four way plug which either connects to a USB peripheral /device or can attach to another hub which provides more ports for peripherals/devices. USB supports connections for most peripherals and devices, such as a monitor, modem, keyboard, printer etc.

Any of these peripherals can provide a further hub for other peripherals to plug in.

The four way connection cable uses two of the four wires to carry electrical power to peripherals /devices.

This cuts down on power supplies.

The remaining two lines, called D+ and D- are used for sending commands and data to the peripheral /device.

A high voltage on D+ but not on D- is binary 1. A high voltage on D- but not on D+ is binary 0.

USB Port

USB32.jpg

When a new USB peripheral is plugged into a port it causes a voltage change on one of the data lines. If the voltage is applied to D+ the peripheral is communicating it's a high-speed device. A high-speed device can send data at 12 megabits a second.

High-speed devices are scanners, monitors, printers and other devices that send a high amount of data. A voltage on D- indicates a slow transfer speed of 1.5Mbps that is right for a keyboard or mouse.

USB Bus

USB_HUB2.jpg

Once the new peripheral is a member of the bus the host controller can poll the device and ask if data is ready to be sent or received and apportion the bus to the device.

Each time this happens a code is sent to the device so the host knows which device it's communicating with.

The code is sent to all devices on the USB bus.

Devices that don’t match the code are ignored. Data is only accepted by those devices that match the code.

Different priorities are given to different devices.

Priority

2spks.jpg

Sound - Highest priority

mouse_top1.jpg

Mouse - Second highest priority

scanner_side_up.jpg

Scanner - Lowest priority

The highest priority goes to those devices that send data where an interruption in the flow of data, such as video or sound would be inappropriate. This is called Isochronous. The second highest priority goes to a keyboard and mouse where an occasional interrupt signal is received. This is called an Interrupt transfer. A third priority, the when time permits priority, is for sending large amounts of data where there is no particular hurry for it to get there. Such as data for printers, scanners and digital cameras. This is called a bulk transfer.