USB on-the-go pin description

Source: Internet
Author: User
USB on-the-go
What is

USB
The interface devices are now everywhere, and almost all the consumer electronic devices that can be imagined by printers, cameras, mobile phones, and MP3 have
USB interface. The fast USB transmission rate, simple interface, and support for hot swapping make it stand out among many interfaces, making it even more unified. However, the traditional USB protocol (USB) limits
This large device group must have a host as the master, usually a PC. The data exchange between the two peripherals can be completed only through the master and sub-transit, which is inefficient and inconvenient. With
Explosive growth, the demand for direct data exchange between two USB devices is getting stronger and stronger, USB
On-the-go came into being. Some manufacturers of mobile phones, PDAs, and mobile devices have developed USB on-the-go (OTG) based on USB ). USB
OTG first solves the problem of point-to-point data exchange between USB devices, avoiding the cumbersome attach to USB host. For example, with USB
OTG, a digital camera can print the photo directly through a printer, instead of copying the photo to a PC, and then the PC Controls the printer to print it.

USB OTG
There are also the following features:

N

The interface is smaller and effectively reduced
Small Size of Electronic Products

N

Both host and
It can be used as a device, that is, DRD (dual-role-devices)

N

OTG
The device can still be connected to the PC and used as a general peripheral, that is, the pod (peripheral-only
Device)

N

Lower power consumption to extend the collection
Battery-powered USB device standby time

USB OTG
Interface


Traditional USB devices include a and B. The device of the ainterface provides the power vbus, which is used as the master node. B interfaces are used as peripherals during communication. Whether it is a, B, or their respective
Although there are some differences in shape, the pins used follow the following definitions:

1
Foot: VCC Power Supply

2
Foot: D-differential negative pole

3
Foot: D + differential positive electrode

4
Pin: Gnd grounding

USB OTG
An ID pin is added. Its Interface (mini-AB) is defined as follows:

1
Foot: vbus

2
Foot: D-

3
Foot: D +

4
Foot: ID

5
Foot: Gnd

USB OTG
Identify whether it is Mini A or mini through the ID signal line
B plug. For ease of use, different connectors have different colors: Mini A is white, mini B is black, and mini AB is gray.

USB OTG
Protocol description

USB OTG
Introduced two new protocols, SRP (Session Request
Protocol) and HNP (host negotiation protocol), that is, the Session Request protocol and the host communication protocol.

SRP
B requests a device to establish a session and use the bus. The a device in the OTG system is generally powered by a battery. Therefore, the OTG System
Power management is very important. To reduce the power consumption of the OTG system, OTG requires that a can turn off the power of vbus when there is no bus activity. In this way, when a device B is connected to a device
Initialize SRP and send it to device A to request the current support from device A on vbus for communication. In OTG, DRD can be either A or B. Therefore
DRD must support SRP initialization and response SRP. The pod can only be a device B, so only SRP can be initialized. Device B can send requests to device a in two ways, requiring the establishment of a SRP: data line pulse
(Data-line pulsing), one is vbus pulse (vbus
Pulsing ). Any device a only needs to be able to respond to one SRP method, while Device B must be able to initialize two SRP methods. This ensures that when Device B initializes a SRP, device
When the response fails, Device B can use another SRP method.

HNP
Used for role switching when two OTG devices are connected. To implement HNP, device a must first allow Device B to pass the latest definition of OTG
Set_feature command to control the bus. Once the request is accepted by device A, Device B can control the bus. If device a wants to give Device B a chance to control the bus, it will stop
To suspend the bus. Then Device B pulls D + down to terminate the previous connection. Then, device a activates the up-pull register at D + to complete the conversion. After that, Device B will act as the master device
And device A will be used as the peripheral device. Similarly, Device B can also suspend the bus and activate the D + upper-pull register. After device a detects a change on the bus, it can clear the D + upper-pull register and repeat the new work.
Control Device usage. In short, when two OTG devices are connected, the Master/Slave status can be negotiated through the HNP protocol.

WinCE
Overview of usb otg driver

USB OTG
The software structure includes three parts:

U

OTG
Controller Driver: including SRP and HNP

U

OTG
Peripheral drive: to implement a standard USB class to implement specific USB peripheral functions

U

OTG
System host driver: includes the host driver, operating system support software, and class libraries supporting peripherals.


For drivers porting this part, pay attention to the ID detection signal,
Vbus control signal. These two signals are generally connected to the gpio of the MCU and are modified based on hardware. SRP and HNP are generally completed by the manufacturer without modification. What I encountered during debugging
The problem is that after the USB flash drive is inserted, the OTG driver detects that the USB flash drive is inserted and provides vbus power supply. However, the communication stops immediately and the USB flash drive cannot be used normally. Later, after further debugging, it was discovered that the USB flash drive is MCU
The power supply of otg_vbus is less than 5 V, and the voltage is about 4.6v when it is not available. After connecting to 5 V, there is no problem. Currently, usb otg supports USB flash disks, and USB mouse keys do not seem to be available.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.