OTG is an abbreviation of On-The-Go, a technology developed in recent years. Announced by the USB Implementers Forum on December 18, 2001, it is mainly used for connection between various devices or mobile devices for data exchange.
Especially Pad, mobile phones, consumer devices. It is inconvenient to change the data exchange between the memory cards of up to 7 formats by changing the connectors of many different formats between devices such as digital cameras, video cameras, printers, etc. It began to spread in the market around 2014.
The development of USB technology has enabled PCs and peripheral devices to connect devices with various data transmission speeds in a simple manner and at moderate manufacturing costs. The applications mentioned above are all connected to the PC via USB and exchange data under the control of the PC.
But this convenient exchange method, once leaving the PC, can not use the USB port to operate between the devices, because no device can act as a host like a PC.
OTG technology is to realize data transmission between devices without Host. For example, the digital camera is directly connected to the printer, and the USB port between the two devices is connected through OTG technology, and the photos taken are printed immediately; the data in the digital camera can also be sent to the mobile hard disk of the USB interface through OTG Therefore, there is no need to carry expensive memory cards or carry a portable computer for field operations.
Through OTG technology, you can extend the USB interface accessories to the smart terminal to enrich the functions of the smart terminal, such as expanding the remote control accessories, turning the mobile phone and tablet into a universal remote control.
According to the protocol of the USB interface, OTG can be divided into 3 categories:
Micro 5PIN OTG: common Android phone OTG interface
Mini 5PIN OTG: common Android tablet OTG interface
Micro USB3.0 OTG: Samsung Note3, Galaxy S5 and other Android phones before 2016 OTG interface
Type C OTG: See Samsung Note 8, Galaxy S8, LeTV, Huawei, etc. Android phone OTG interface after 2016
Lightning OTG: OTG for Apple phones
With the popularization of consumer products such as PAD, mobile phones, digital cameras, printers, etc., the high-speed data transmission technology used for these devices and computers, or between devices and devices has attracted more and more attention. IEEE1394 and USB are used for The two main standards for this type of transmission.
Both of these standards provide plug-and-play and hot-swap functions, both can provide power to the outside, and also support the connection of multiple devices. Among them, IEEE1394 supports higher data transmission speeds, but is relatively complex and expensive, and is mainly used for AV products that require high-speed communication; while the original USB standard is mainly for low-speed data transmission applications, of which USB1.1 supports 1.5Mbps and The transmission rate of 12Mbps is widely used in PC peripherals with low transmission rate requirements, such as keyboard and mouse. The introduction of the USB2.0 standard enables the transmission speed of USB to reach 480Mbps. And the introduction of USB OTG technology can realize the data transmission between the device without the host. For example, a digital camera can be directly connected to a printer and print photos, thereby expanding the application range of USB technology.
Everyone knows that since the birth of the USB transfer protocol in 1996, it quickly swept all computer peripherals and digital devices with its advantages. Everyone knows that USB devices are divided into HOST (master device) and SLAVE (slave device). Only when a HOST is connected to a SLAVE can data transmission be realized. OTG equipment is our "EX" that can act as both HOST and SLAVE.
The USB OTG standard adds power management (section
Power saving function, which allows the device to operate as both a host and a peripheral (dual-purpose OTG). The OTG dual-use device is fully compliant with the USB2.0 standard, and can provide certain host detection capabilities, supporting host pass-through protocol (HNP) and dialog request protocol (SRP). In OTG, the initial host device is called the A device, and the peripheral device is called the B device. The initial role can be determined by the cable connection. Figure 1 is a schematic diagram of the fifth ID pin to determine the default host. The dual-purpose device uses a new mini-AB socket, thereby adding a fifth pin to the mini-A plug, mini-B plug and mini-AB socket. (ID) to identify different cable end points. The ID pin in the mini-A plug is grounded, and the ID pin in the mini-B plug is floating. When the OTG device detects the grounded ID pin, it means that the default is the A device (host), and the device that detects the floating ID pin is considered to be the B device (peripheral). Once the system is connected, the role of OTG can be changed. The host and peripherals use the new HNP, A device as the default host and provides VBUS power, and resets the bus, enumerates and configures the B device when a device connection is detected. The second new protocol added to the USB by the OTG standard is called the dialog request protocol (SRP). SRP allows the B device to request the A device to turn on the VBUS power and initiate a conversation. An OTG conversation can be determined by the time when the A device provides VBUS power (Note: The A device always supplies power to VBUS, even as a peripheral). You can also turn off the VBUS power of the A device to end a session to save power consumption, which is very important in battery-powered products. For example, when two cellular phones exchange information with each other through a connection, one is connected to the mini-A end of a power-consuming device, which is the A device, and the default is the host. The other is a B device, which is a peripheral by default. When USB communication is not required, the A device can turn off the VBUS line, and the B device will detect this state and enter the low power consumption mode.
Host Negotiation Protocol
In the USB standard, the host uses an A-type interface called A-Device; the peripheral uses a B-type interface called B-Device. One DRD can be used either as a host or as a peripheral. So, when two DRDs are interconnected, which device is used as the host, and why should it be used as the host? To solve these two problems, a new protocol, Host Negotiation Protocol (HNP), is proposed in OTG. A new interface is also defined in OTG-mini-AB receptacle, as well as mi-ni-A plug and mini-B plug. In the miniature AB socket, miniature A plug and miniature B plug, 1 pin is added-the ID pin, as shown in Figure 1. Host Negotiation Protocol (HNP)
In the micro A plug, the ID pin is grounded, and in the micro B plug, the ID pin is floating. In OTG, if the ID pin of the device is grounded (that is, the device connected by the mini-A plug, as shown in the right side of Figure 1), then this device is the host by default, otherwise it is a peripheral. At the same time, during the connection of the device, the host negotiates protocols to allow the host and peripheral functions to be interchanged. For example, assume that the B-Device on the left of Figure 1 is a handheld PDA and the A-Device on the right is a printer. Due to the connection line, the printer is initialized as the host. However, the driver of the printer is stored in the PDA. At this time, the PDA needs to be the host and the printer to be the peripheral. This function can be easily realized through HNP, without having to unplug the cable to change the direction of the plug and reconnect the printer and PDA.
Session Request Protocol
OTG transceivers are generally used in embedded devices, which are generally battery-powered and have strict requirements on power consumption. In order to save power, in the OTG standard, when the power bus is not in use, Class A devices are allowed to suspend the power bus.
When a Class B device is to work, it must notify the Class A device to supply power to the power bus by some method. In order to realize this function, Session Request Protocol (SRP) is proposed in OTG. In OTG, one session is defined as the time when the Class A device effectively supplies power to the power bus VBUS. It should be noted that in OTG, power is always provided by Class A equipment (DRD connected to mini-Aplug). Because the host negotiates a protocol, Class A devices may also be used as peripherals. In this case, power must also be provided by Class A devices. When the Class A device suspends VBUS, the Class B device enters the sleep state. When the Class B device needs to work again, it can request the Class A device to supply power to the power bus by sending a pulse signal (Data-linePulsing) to the data line or a pulse signal (VBUSPulsing) to the power bus. OTG requires that both DRD devices and ordinary Class B devices must have the function of sending session requests; meanwhile, ordinary Class A devices or DRD devices must be able to respond to one session request.
OTG function construction
The circuit shows the circuit that needs to be added to the basic USB peripheral when constructing the OTG function. The universal serial bus controller in the circuit can be a microprocessor and USB SIE (serial port engine), or it can be an integrated μP/USB Chip or ASIC connected to USB transceiver. The external device that supplies power to the bus needs a 3.3V regulated output power supply voltage to provide power for the logic circuit and the 1500Ω resistor connected to the D+ and D- pins. The pull-up resistors on the D+ and D- pins can send a signal that the device is connected to the host and indicate the working speed of the device. Pulling the resistor up to D+ means running at full speed, and pulling up to D- means running at low speed. Other endpoints (including the 15kΩ pull-down resistors of D+ and D-) are used to detect the status of the pull-up resistor. Due to the USB design, hot plugging is required. Therefore, its ESD protection circuit is mainly used to provide protection for the D+, D- and VBUS pins.
In order to increase the dual-purpose function of OTG, the transceiver function must be expanded so that the OTG device can be used as both a host and a peripheral. To achieve the above functions, you need to add 15kΩ pull-down resistors at the D+ and D- terminals in the circuit shown in Figure 3 and provide power supply for VBUS. In addition, the transceiver also needs to have the following three conditions:
(1) The pull-up and pull-down resistors on the D+/D- line can be switched to provide peripheral and host functions.
(2) When it is used as A device, it needs to have VBUS monitoring and power supply circuit; when it is used as B device to initialize SRP, it needs to monitor and trigger VBUS.
(3) With ID input pin.
As a dual-purpose OTG device, ASIC, DSP, or other circuits connected to the transceiver must have the functions of acting as a peripheral and a host, and should switch its role according to the HNP protocol.
Most of the circuits that the transceiver needs to add are used for VBUS pin management. As a host, it must be able to provide a 5V power supply with an output current of up to 8mA. The analog switch in Figure 3 is used to configure various functions of the transceiver.
ASIC and controller must also include USB host logic control functions, including sending SOF (frame start) packet, sending configuration\u36755 input\u36755 output data packet, determining the transmission process in USB 1 msec frame, sending USB reset signal, providing USB Power management, etc.
Use of OTG line function
The use of OTG is very simple, and it has something to do with the device, but they are similar.
Since the USB1.0 specification in 1996, USB-IF (Universal Serial Bus Implementers Forums) has successively announced several specifications such as USB2.0 and USB OTG, among which USB2.0 has a transmission bandwidth of 480Mbps, and USB OTG makes USB The device got rid of the limitations of the original master-slave architecture and realized the end-to-end transmission mode. With the continuous improvement of the USB specification, the application field of USB has also been expanded. The original intention of the birth of USB is to simplify the connection between computers and their peripherals. It was first used in keyboards and mice. The application of USB has crossed from PC peripherals to consumer electronics and communication electronics. The most obvious application is in digital cameras. And other consumer electronics products. The characteristics of USB low power consumption, easy connection and high-speed transmission have made it a framework that can be easily applied, and it has been combined with other technologies to create new applications. For example, in the field of mobile storage, the combination of USB and flash memory has created a popular mobile storage device-U disk.
"In-stat/MDR statistics also show that the peripheral devices of USB2.0 OTG interface will increase from 110,000 in 2002 to 168 million in 2007, an increase of 1527 times. It can be seen that with the peripheral The diversification of devices and the demand for high-speed transmission, the follow-up development trend of USB 2.0 OTG is very optimistic." From the perspective of industry applications, many companies have announced that they will configure the USB OTG function for their products. It is foreseeable that USB OTG will become the basic configuration function of future electronic products.
FPGA Spartan-3A DSP Family 1.8M Gates 37440 Cells 667MHz 90nm Technology 1.2V 484-Pin LCSBGA
FPGA Spartan-3A DSP Family 1.8M Gates 37440 Cells 667MHz 90nm Technology 1.2V 676-Pin FBGA
FPGA Spartan-3A DSP Family 3.4M Gates 53712 Cells 667MHz 90nm Technology 1.2V 484-Pin BGA
FPGA Virtex-5 FXT Family 65nm Technology 1V 1738-Pin FCBGA