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:

    Defaced ruins of architecture and statuary, like the wrinkles of decrepitude of a once beautiful woman, only make one regret that one did not see them when they were enchanting.
    Horace Walpole (1717–1797)

    In short, the building becomes a theatrical demonstration of its functional ideal. In this romanticism, High-Tech architecture is, of course, no different in spirit—if totally different in form—from all the romantic architecture of the past.
    Dan Cruickshank (b. 1949)

    And when his hours are numbered, and the world
    Is all his own, retiring, as he were not,
    Leaves, when the sun appears, astonished Art
    To mimic in slow structures, stone by stone,
    Built in an age, the mad wind’s night-work,
    The frolic architecture of the snow.
    Ralph Waldo Emerson (1803–1882)