USB On-The-Go - Architecture

Architecture

Standard USB uses a master/slave architecture; a host acts as the master device for the entire bus, and a USB device acts as the slave. Devices are designed from the start to act in one role or the other - computers are generally set up to be hosts, while printers (for instance) are normally slaves.

When a device is plugged into the USB bus, the master device, or host, sets up communications with the device and handles service provisioning. The host is responsible for all data transfers over the bus, with the devices only able to signal that they require attention. To transfer data between two devices, from a phone to a printer for instance, the host first reads the data from one device then writes it to the other. This allows the devices to be greatly simplified compared to the host; a mouse, for instance, contains very little logic and relies on the host to do almost all of work.

While the master/slave arrangement works for some devices, there are many devices that might want to act as a master or a slave depending on who else shares the bus. For instance, a computer printer is normally a slave device, but when a USB flash drive of images is plugged into the USB port of the printer with no computer present (or at least turned off) it would be useful for the printer to take on the role of host, allowing it to communicate with the flash drive directly and print images from it.

USB On-The-Go introduces the concept that a device can perform both the master and slave roles, and so subtly changes the terminology. With OTG, a device can be either a host when acting as the link master, or a peripheral when acting as the link slave. The choice of whether to be host or peripheral is handled entirely by which end of the cable the device is plugged into. The device connected to the "A" end of the cable at start-up, known as the "A-device", acts as the default host, while the "B" end acts as the default peripheral, known as the "B-device".

After initial startup, setup for the bus operates as it does with the normal USB standard, with the A-device setting up the B-device and managing all communications. However, when that same A-device is plugged into another USB system, or a dedicated host becomes available, it may become a slave.

USB On-The-Go does not preclude using a USB hub, but it describes host/peripheral role swapping only for the case of a one-to-one connection where two OTG devices are directly connected. Role swapping does not work through a standard hub, as one device will act as the host and the other as the peripheral until they are disconnected.

Read more about this topic:  USB On-The-Go

Famous quotes containing the word architecture:

    Art is a jealous mistress, and if a man have a genius for painting, poetry, music, architecture or philosophy, he makes a bad husband and an ill provider, and should be wise in season and not fetter himself with duties which will embitter his days and spoil him for his proper work.
    Ralph Waldo Emerson (1803–1882)

    No architecture is so haughty as that which is simple.
    John Ruskin (1819–1900)

    The principle of the Gothic architecture is infinity made imaginable.
    Samuel Taylor Coleridge (1772–1834)