拙网论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 176|回复: 0

USB HOST与USB OTG有什么区别(USB On-The-Go)

[复制链接]

949

主题

1001

帖子

3736

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3736
发表于 2018-5-2 19:06:03 | 显示全部楼层 |阅读模式
电脑用户经常使用USB接口,连接U盘或移动硬盘等。但是,知道USB HOST和USB OTG的却不多,现在分享一下这方面的知识,便于以后用到这些设备时知道它们的区别和使用方法。  
USB设备分为HOST(主设备)和SLAVE(从设备),只有当一台HOST与一台SLAVE连接时才能实现数据的传输。
(1)USB HOST是指主机。
(2)USB OTG设备既能做主机,又能做设备。
OTG技术就是实现在没有Host的情况下,实现从设备间的数据传送。
当OTG 插到电脑上时,OTG 的角色就是连接电脑的device(读卡器),也就是SLAVE(从设备);当USB/SD device 插到 OTG 上,OTG 的角色就是 HOST(主机)。有些手机也经常用到OTG功能。


https://en.wikipedia.org/wiki/USB_On-The-Go

Standard USB uses a master/slave architecture; a host acts as the master device for the entire bus, and a USB device acts as a slave. If implementing standard USB, devices must assume one role or the other, with computers generally set up as hosts, while (for example) printers normally function as slaves. In the absence of USB OTG, cell phones often implemented slave functionality to allow easy transfer of data to and from computers. Such phones, as slaves, could not readily be connected to printers as they also implemented the slave role. USB OTG directly addresses this issue.

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's software enables or does the needed data-handling such as file managing or other desired kind of data communication or function). That allows the devices to be greatly simplified compared to the host; for example, a mouse contains very little logic and relies on the host to do almost all of the work. The host controls all data transfers over the bus, with the devices capable only of signalling (when polled) that they require attention. To transfer data between two devices, for example from a phone to a printer, the host first reads the data from one device, then writes it to the other.

While the master-slave arrangement works for some devices, many devices can act either as master or as slave depending on what else shares the bus. For instance, a computer printer is normally a slave device, but when a USB flash drive containing images is plugged into the printer's USB port 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 to print images from it.

USB OTG recognizes that a device can perform both master and slave roles, and so subtly changes the terminology. With OTG, a device can be either a host when acting as a link master, or a "peripheral" when acting as a link slave. The choice between host and peripheral roles is handled entirely by which end of the cable the device is connected to. 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 the same A-device is plugged into another USB system or a dedicated host becomes available, it can become a slave.

USB OTG 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 a host and the other as a peripheral until they are disconnected.

Specifications
USB OTG is a part of a supplement[2] to the Universal Serial Bus (USB) 2.0 specification originally agreed upon in late 2001 and later revised.[3] The latest version of the supplement also defines behavior for an Embedded Host which has targeted abilities and the same USB Standard-A port used by PCs.

SuperSpeed OTG devices, Embedded Hosts and peripherals are supported through the USB OTG and Embedded Host Supplement[4] to the USB 3.0 specification.



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|抱朴守拙BBS

GMT+8, 2025-5-26 05:31 , Processed in 0.196243 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表