USB On-The-Go Basics

abstract: usb on-the-go (otg) allows two usb devices to talk to each other without requiring the services of a personal computer. although otg appears to add peer to peer connections to usb, it does not. instead, usb otg retains the standard usb host/peripheral model, where a single host talks to usb peripherals. otg introduces the dual-role device (drd), capable of functioning as either host or peripheral. part of the magic of otg is that a host and peripheral can exchange roles if necessary.
before otg, the concept of an embedded host was already established in the usb world. instead of duplicating the full uhci/ohci usb controllers and drivers built into personal computers, most embedded host chips provide limited hosting capabilities. this makes them better suited to the embedded environment than to the pc with its huge resources and infinite capacity for drivers and application software.
introductionusb on-the-go (otg) allows two usb devices to talk to each other without requiring the services of a personal computer (pc). although otg appears to add peer-to-peer connections to the usb world, it does not. instead, usb otg retains the standard usb host/peripheral model, in which a single host talks to usb peripherals. otg does introduce, however, the dual-role device, or simply stated, a device capable of functioning as either host or peripheral. part of the magic of otg is that a host and peripheral can exchange roles if necessary.
before otg, the concept of an embedded host was already established in the usb world. instead of duplicating the full uhci/ohci usb controllers and drivers built into pcs, most embedded host chips provide limited hosting capabilities. this makes them better suited to the embedded environment than a pc with its huge resources and infinite capacity for drivers and application software.
an otg device may, or may not be capable of functioning as a host. it is likely, nonetheless, that most otg devices will be dual-role. usb peripheralsfigure 1 illustrates the basic usb peripheral circuitry on which otg builds. these example peripherals operate at low or full speed, and are commonly known as usb 1.1 devices. this nomenclature is used even though the usb 2.0 specification includes the current usb 1.1 specification and introduces a third, higher speed.
figure 1. a usb peripheral controller and its associated circuitry.
the controller in figure 1 might be a microprocessor plus usb sie (serial interface engine), an integrated microprocessor/usb chip, or an asic connected to a usb transceiver. a bus-powered peripheral requires a 3.3v regulator, both to power the logic and to supply the proper voltage to a 1500ω resistor connected to either the d+ or d- usb pins. this pullup resistor signals the host that a device is connected, and indicates the device's operating speed. a pullup to d+ indicates full speed; a pullup to d- indicates low speed. the other end of the connection—host or hub—contains 15kω pulldown resistors on d+ and d- so the pullup resistor can be detected. finally, an esd protection circuit is advisable on d+, d-, and vbus pins because usb is designed to be hot-plugged. how to be a hostthe figure 1 circuit functions only as a usb peripheral device. to add otg dual-role capability, the transceiver must be augmented to allow the otg device to function as either host or peripheral. adding the following to figure 1 lets the system also function as a host: 15kω pulldown resistors on d+ and d- a means to supply, rather than draw, power on vbus the asic or controller must also contain logic to function as a usb host. some of the host duties absent in a peripheral device are: send sof (start of frame) packets. send setup, in, and out packets. schedule transfers within usb 1ms frames. signal usb reset. provide usb power management. in addition to requiring a dual-role peripheral/host usb controller, otg requires additional circuitry to support two new protocols, called hnp and srp. host negotiation protocolan otg dual-role device can operate either as a host or peripheral. in otg nomenclature, the initial host is called the a-device, and the initial peripheral is called the b-device. the word initial is important. once connected, otg dual-role devices can exchange roles—host and peripheral—by using the new host negotiation protocol (hnp). hnp raises two obvious questions: (a) how are the initial roles determined; and (b) why is the role reversal necessary?
figure 2. fifth id pin determines default host.
the cable orientation determines the initial roles (figure 2). dual-role devices use a new receptacle called the mini-ab. the mini-a plug, the mini-b plug and the mini-ab receptacle add a fifth pin (id) to give different electrical identities to the cable ends. this fifth id pin is connected to ground inside the mini-a plug and left floating in the mini-b plug. the otg device receiving the grounded id pin is the default a-device (host); the device with the floating id pin is the default b-device (peripheral).
figure 3. otg cable is inserted backwards.
to understand the need for the hnp and host/peripheral role reversal, the example in figure 3 shows two dual-role devices, a pda and a printer. the pda has a printer driver inside. the two devices are connected with the new otg cable as shown, making the printer the default host (a-device) and the pda the default peripheral (b-device). but this setup is backwards. the pda, which has the printer driver, needs to act as usb host to the printer, which contains no driver. rather than bothering the user to reverse the cable, hnp allows the devices' roles to reverse automatically and silently. session request protocolthe otg specification adds a second new protocol to usb, called session request protocol (srp). srp allows a b-device to request an a-device to turn on vbus power and start a session.
an otg session is defined as the time that the a-device is furnishing vbus power. (note: the a-device always supplies vbus power, even if it is functioning as a peripheral due to hnp.) the a-device can end a session by turning off vbus to conserver power, a very important requirement in a battery-powered device such as a cell phone.
figure 4. otg session request protocol (srp).
figure 4 shows a common ogt application: two cell phones connected together to exchange information. the right phone received the mini-a end of the cable, making it the a-device and thus defaulting into the host role. the left phone is the b-device, defaulting to peripheral. if there is no need to communicate over usb, the a-device can power down the vbus wire, which the b-device can detect so that it too can enter a low-power state.
now suppose that the user of the left phone presses a button to synchronize address books, or any other action that requires a usb session. the ‘srp pulse' block in the left phone pulses first the d+ wire, and then the vbus wire to wake up the a-device. (the a-device can respond either to d+ or vbus pulsing.) the a-device then detects the pulse, causing it to switch on vbus and start a session.
the srp protocol is more complex than this simple illustration. the b-device, for example, must first measure vbus to ensure that a session is not in progress. it must also be able to differentiate between a classic pc or an otg device at the other end of the cable. it does this by delivering measured amounts of current to the vbus wire and noting the resulting voltage.
once a session is underway, the devices may or may not use hnp. otg transceiverwe are now ready to examine the requirements for an otg transceiver, illustrated in figure 5.
figure 5. an otg transceiver.
the figure 5 system builds on the figure 1example circuit. the asic block could also be a microprocessor or dsp with usb capability. three additions make the transceiver otg compatible: switchable pull-up and pull-down resistors on d+/d- to allow peripheral or host functionality. circuitry to monitor and supply 5v power on vbus as an a-device, and to monitor and pulse vbus as a b-device initiating srp. an id input pin, which is made available as an output to the asic. for this system to operate as a dual-role otg device, the asic, dsp, or whatever is connected to the transceiver must be capable both of functioning as a peripheral or host, and of switching roles on-the-fly as a result of hnp.
most of the added transceiver circuitry manages the vbus pin, which now must also supply 5v power at 8ma as a host, and perform vbus pulsing as a peripheral. analog switches configure the transceiver for the various roles that it must play.

解决物联网中的隐私安全问题,建立数据保护系统
英特尔超10亿美元收购Habana Labs?英特尔没有回应
百度创维联手进军AI 人工智能电视大战将启!
空调选购分三步走 保管你挑选到心仪的产品
NVIDIA Spectrum-3交换机的应用性能
USB On-The-Go Basics
RK358支持全链路ECC的DDR和普通内存有何区别?
vivo新品S6将于3月末发布售价在2000-3000元之间
Vishay Siliconix发布新款N沟道TrenchFET功率MOSFET-SiR872ADP
为什么UV胶水固化后会脱胶
基于Si3480设计的PoE电源管理技术
通讯设备、物联网及智慧城市企业九联科技发布2022第一季度报告
三星将推出Odyssey G9新显示器,首款1000R曲线的消费级显示器
逆变器费电怎么办,必须平稳运行
iphone8什么时候上市?iphone8最新消息:脸部识别+无线充电+梦幻外形,售价创新高,你攒钱了吗?
AI芯片的架构和传统芯片有什么不同?
全球制造业将颠覆式场景,企业应当如何做出正确的决策?
CPU的内部组成部分有哪些 CPU 的主要功能
全新蜂窝物联网解决方案里SIM、eSIM和iSIM的区别是什么
中控智慧科技梯控EC-200介绍