USB devices are divided into three types: HOST, OTG, DEVICE. The ID pin is used in the OTG function.
A, if your system is only used as a Slave, then use the B interface. Leave Slave at all times.
If it is an OTG device, its system controller will determine the level of the ID pin of the external device and determine what kind of device is inserted:
B, if it is high, then B connector is inserted, then the OTG device will be master mode;
C. If the ID is low, then the A interface is inserted, and then the OTG device will use the HNP dialogue protocol to determine which of the peripherals it uses as the Master and which of the Slave.
D, there is a kind of active OTG setting, that is, after accessing the peripherals, clicking on the HOST enable in the OTG device will force the ID to pull down. At this point, the relationship between Master and Slave is determined.
The type B Mini-USB port is generally used on our mobile phones.
(1) USB
(2)Mini USB
(3) Summary
From left to right: miniUSB male (A-type plug), miniUSB male (B-type plug), USB male (B-type), USB female (A-type), USB male (A-type) .
(4) OTG
Features: It can be used as both a HOST and a Device (Dual-role-devices). An OTG device can still be connected to a PC and used as a normal peripheral device (Peripheral-Only Device). Brief description of the protocol: Two new protocols are introduced in the USB OTG, the Session Request Protocol (SRP) and the Host NegoTIaTIon Protocol (HNP), namely the session request protocol and the host exchange protocol.
(5) SRP
The SRP is used by the B device to request the A device to establish a session and use the bus. The A equipment in the OTG system is generally powered by batteries. Therefore, the power management of the OTG system is very important. In order to save the power consumption of the OTG system, OTG specifies that the A device can turn off the power on the VBus when there is no bus activity. In this way, when a B device is connected to the A device, the SRP is initialized and sent to the A device, requesting the A device to provide current support on the VBus for further communication. In OTG, a session is defined as the time for a class A device to effectively supply power to the power bus VBUS. DRD can be regarded as A apparatus, can also regard as B apparatus, so DRD must support initializing SRP and responding SRP, POD can only be as B apparatus, so can only initialize SRP.
(6) HNP
HNP is used to switch roles when two OTG devices are interconnected. When 2 DRDs are interconnected, which device is the host, why should it be the host? In order to solve these two problems, a new protocol was proposed in the OTG - Host Negotiation Protocol (HNP). A new interface is also defined in the OTG - a mini-AB receptacle as well as a mi-ni-A plug and a mini-B plug. A pin is added to the micro-AB socket, micro-A plug, and micro-B plug. The ID pin is used to realize the HNP. In short, when the two OTG devices are interconnected, the master/slave status can be negotiated through the HNP protocol. . The negotiation process is as follows:
In the micro-A plug, the ID pin is grounded. In the micro-B plug, the ID pin is floating. In OTG, if the device's ID pin is grounded (as in the device on the right side of Figure 1), this device defaults to the master, otherwise it is a peripheral. At the same time, through the host negotiation protocol, the host and peripheral functions are allowed to exchange during the connection of the device. 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. Because of the connection line, the printer is initialized as a host. However, the printer driver exists in the PDA. At this time, the PDA is required as a host and the printer as a peripheral. This function can be easily realized through HNP, without having to unplug the cable to change the direction of the plug, reconnect the printer and PDA.
LAN CABLE Cat5e/Cat6/Cat7/Cat8 Cable
CIXI LANGUANG PHOTOELECTRIC TECHNOLOGY CO..LTD , https://www.cxblueray.com