eefocus术语辞典

首页 |

USB编辑词条 | 加入收藏

中文解释:通用串行总线
英文缩写:USB
英文来历:Universal Serial Bus
  USB是一种由Intel和Microsoft开发的外设总线的数据通信标准。最大的特点是支持热插拔(Hot plug)和即插即用 (Plug&Play)。当设备插入时,主机枚举(enumerate)此设备并加载所需的驱动程序,因此使用远比PCI和ISA总线方便。它改变了在台式PC背面安装过多连接器和端口的状况,并提供用于计算机电话...


通用串行总线[编辑] [顶部]

/

  USB是一种由Intel和Microsoft开发的外设总线的数据通信标准。最大的特点是支持热插拔(Hot plug)和即插即用 (Plug&Play)。当设备插入时,主机枚举(enumerate)此设备并加载所需的驱动程序,因此使用远比PCI和ISA总线方便。它改变了在台式PC背面安装过多连接器和端口的状况,并提供用于计算机电话设备的接口。USB对键盘、鼠标、打印机、调制解调器、游戏杆、音频设备、CD.ROM、数字相机和其他设备提供单一连接端口,而不是对它们分别进行连接。USB消除了与PC有关的很多问题,例如要拆开计算机才能安装适配卡、更换双列直插开关、配置IRQ(中断请求)等。 USB定义的端口和总线拓扑结构具有高达12Mbit/s的数据传输速率。它使用一条长达5米的电缆将设备以菊化链的形式串接到一个单一端口上。在这种设计中,可以在不需要重新启动系统的情况随时添加设备,最多可达63台。该拓扑结构是分层的星形结构,它允许外部设备连接到可提供多个端口连接器的中继集线器。在某些情况下,集线器可能需要电源。USB还对某些设备提供电源,因此它们将不需要电线和电池。USB甚至允许设备就它们的电源需求与USB主机控制器进行通信。

  /USB速度比并行总线(Parellel Bus,例如EPP、LPT)与串行端口(Serial Port,例如RS-232)等传统计算机用标准总线快许多。USB有两个规范,即USB 1.1和USB 2.0。

  通用串行总线Universal Serial Bus (USB) 是连接外部设备的一个串口总线标准,在计算机上使用广泛,但也可以用在机顶盒和游戏机上,补充标准(On-The-Go)使其能够用于在便携设备之间直接交换数据。

  USB的设计为非对称式的,它由一个主机(host)控制器和若干通过hub设备以树形连接的设备组成。 一个控制器下最多可以有5级hub,包括Hub在内,最多可以连接127个设备,而一台计算机可以同时有多个控制器。 和SPI-SCSI等标准不同,USB hub不需要终结器。

/ 
USB hub

  USB可以连接的外设有鼠标、键盘、gamepad、游戏杆、扫描仪、数码相机、打印机、硬盘和网络部件。对数码相机这样的多媒体外设USB已经是缺省接口;由于大大简化了与计算机的连接,USB也逐步取代并口成为打印机的主流连接方式。2004年已经有超过1亿台USB设备;到2005年显示器和高清晰度数字视频外设是仅有的USB未能染指的外设类别,因为他们需要更高的传输速率。

  现标准中将UBS统一为USB2.0,分为高速:传输速率25Mbps~400Mbps(最大480Mbps);全速:传输速率500Kbps~10Mbps(最大12Mbps);低速:传输速率10Kbps~100Kbps(最大1.5Mbps)

标准

  USB Implementers Forum (USBIF)负责USB标准制订,其成员包括苹果电脑、惠普、NEC、微软和Intel。USBIF于2001年底公布了2.0规范,之前还有0.9、1.0、和1.1,他们都是完全向后兼容的。On-The-Go Supplement to the USB 2.0 Specification的当前版本是1.0a。

  USB的连接器分为A、B两种,分别用于主机和设备;其各自的小型化的连接器是Mini-AMini-B,另外还有Mini-AB的插口。

技术细节

技术指标

目前USB支持3种数据信号速率,USB设备应该在其外壳或者有时是自身上正确标明其使用的速率。USB-IF进行设备认证并为通过兼容测试并支付许可费用的设备提供基本速率(低速和全速)和高速的特殊商标许可。

机械和电气标准

标准USB接口

/ 
USB标准A、 B插头及其触点(未按比例绘制)

标准USB连接器触点
触点 功能(主机) 功能 (设备)
1 VBUS (4.75-5.25 V) VBUS (4.4-5.25 V)
2 D- D-
3 D D
4 接地 接地

USB信号使用分别标记为D 和D-的双绞线传输,它们各自使用半双工差分信号并协同工作,以抵消长导线的电磁干扰,

Mini USB接口

/ 
Mini USB A、 B连接器及其触点(未按比例绘制)

Mini USB连接器触点
触点 功能
1 VBUS (4.4–5.25 V)
2 D−
3 D
4 ID
5 接地

除了第4针,其他标准和mini USB接口功能相同。第4针成为ID,在mini-A上连接到第5针,在mini-B可以悬空亦可连接到第5针。

软件架构

  一个USB主机通过hub链可以连接多个设备。由于理论上一个物理设备可以承担多种功能,例如路由器同时也可以是一个SD卡读卡器,USB的术语中设备(device)指得是功能(functions)。集线器(hub)由于作用特殊,按照正式的观点并不认为是function。 直接连接到主机的hub是根(root)hub。

端点

  设备/功能(和集线器)与管道pipe (逻辑通道)联系在一起,管道把主机控制器和被称为端点endpoint的逻辑实体连接起来。 管道和比特流(例如UNIX的pipeline)有着相同的含义,而在USB词汇中术语端点经常和管道混用,甚至在正式文档中。

  端点(和各自的管道)在每个方向上按照0-15编号,因此一个设备/功能最多有32个活动管道,16个进,16个出。 (OUT)指离开控制器,而IN)指进入主机控制器。) 两个方向的端点0总是留给总线管理,占用了32个端点中的2个。在管道中,数据使用不同长度的包传递,端点可以传递的包长度上限一般是< math>2^n</math>字节,所以USB包经常包含的数据量依次有8、16、32、64、128、256、512或者024字节。

  一个端点只能单向(进/出)传输数据,自然管道也是单向的。每个USB设备至少有两个端点/管道:它们分别是进出方向的,编号为0,用于控制总线上的设备。按照各自的传输类型,管道被分为4类:

一旦设备(功能)通过总线的hub附加到主机控制器,主机控制器就给它分配一个主机上唯一的7位地址。主机控制器通过投票分配流量,一般是通过轮询模式,因此没有明确向主机控制器请求之前设备不能传输数据。W

为了访问端点,必须获得一个分层的配置。连接到主机的设备有且仅有一个设备描述符device descriptor),而设备描述符有若干配置描述符(configuration descriptors)。这些配置一般与状态相对应,例如活跃和节能模式。 。每个配置描述符有若干界面描述符,用于描述设备的一定方面,所以可以被用于不同的用途:如一个相机可能拥有视频和音频两个界面。界面描述符有一个缺省界面设置default interface setting)和可能多个替代界面设置alternate interface settings),它们都拥有如上所述的端点描述符。一个端点能够在多个界面和替代界面设置之间复用。

HCD

The hardware that contains the host controller and the root hub has an interface toward the programmer which is called Host Controller Device (HCD) and is defined by the hardware implementer. In practice, these are hardware registers (ports) in the computer.

At version 1.0 and 1.1 there were two competing HCD implementations. Compaq's Open Host Controller Interface (OHCI) was adopted as the standard by the USB-IF. However, Intel subsequently created a specification they called the Universal Host Controller Interface (UHCI) and insisted other implementers pay to license and implement UHCI. VIA Technologies licensed the UHCI standard from Intel; all other chipset implementers use OHCI. The main difference between OHCI and UHCI is the fact that UHCI is more software-driven than OHCI is, making UHCI slightly more processor-intensive but cheaper to implement (excluding the license fees). The dueling implementations forced operating system vendors and hardware vendors to develop and test on both implementations which increased cost. During the design phase of USB 2.0 the USB-IF insisted on only one implementation. The USB 2.0 HCD implementation is called the Extended Host Controller Interface (EHCI). Only EHCI can support high-speed transfers. Each EHCI controller contains four virtual HCD implementations to support Full Speed and Low Speed devices. The virtual HCD on Intel and Via EHCI controllers are UHCI. All other vendors use virtual OHCI controllers.

某些版本的Microsoft Windows上,打开设备管理器,如果设备说明中是否有“增强”("Enhanced"),就能够确认它是2.0版的。而在Linux系统中,命令lspci能够列出所有的PCI设备,而USB会分别命名为OHCI、UHCI或者EHCI。

设备分类

Devices that attach to the bus can be full-custom devices requiring a full-custom device driver to be used, or may belong to a device class. These classes define an expected behaviour in terms of device and interface descriptors so that the same device driver may be used for any device that claims to be a member of a certain class. An operating system is supposed to implement all device classes so as to provide generic drivers for any USB device. The most used device classes are:

设备的分类取决于USB构建论坛的设备工作组。

 

USB连接器

The connectors which the USB committee specified were designed to support a number of USB's underlying goals, and to reflect lessons learned from the varied menagerie of connectors then in service. In particular:

The USB 1.0, 1.1 and 2.0 specifications define two types of connectors for the attachment of devices to the bus: A, and B. However, the mechanical layer has changed in some examples. For example, the IBM UltraPort is a proprietary USB connector located on the top of IBM's laptop LCDs. It uses a different mechanical connector while preserving the USB signaling and protocol. Other manufacturers of small items also developed their own small form factor connector, and a wide variety of these have appeared. For specification purposes, these devices were treated as having a captive cable.

An extension to USB called USB On-The-Go allows a single port to act as either a host or a device - chosen by which end of the cable plugs into the socket on the unit. Even after the cable is hooked up and the units are talking, the two units may "swap" ends under program control. This facility targets units such as PDAs where the USB link might connect to a PC's host port as a device in one instance, yet connect as a host itself to a keyboard and mouse device in another instance. USB On-The-Go has therefore defined two small form factor connectors, the mini-A and mini-B, and a hermaphroditic socket (mini-AB), which should stop the proliferation of proprietary designs.

The maximum length of a USB cable is 5 meters; greater lengths require hubs [1].

/ 
 
                     常用的USB延长线

电源

The USB connector provides a single nominally 5 volt wire from which connected USB devices may power themselves. In practice, delivered voltage can drop well below 5 V, to only slightly above 4 V. The compliance spec requires no more than 5.25 V anywhere and no less than 4.375 V at the worst case; a low-power function after a bus-powered hub. In typical situations the voltage is close to 5.

A given segment of the bus is specified to deliver up to 500 mA. This is often enough to power several devices, although this budget must be shared among all devices downstream of an unpowered hub. A bus-powered device may use as much of that power as allowed by the port it is plugged into.

Bus-powered hubs can continue to distribute the bus provided power to connected devices but the USB specification only allows for a single level of bus-powered devices from a bus-powered hub. This disallows connection of a bus-powered hub to another bus-powered hub. Many hubs include external power supplies which will power devices connected through them without taking power from the bus. Devices that need more than 500 mA or higher than 5 volts must provide their own power.

When USB devices (including hubs) are first connected they are interrogated by the host controller, which enquires of each their maximum power requirements. The host operating system typically keeps track of the power requirements of the USB network and may warn the computer's operator when a given segment requires more power than is available (and will generally shut down devices or hubs in order to keep power consumption within the available resource).

A number of devices use this power supply without participating in a proper USB network. The typical example is a USB-powered reading light, but fans, battery chargers (particularly for mobile telephones) and even miniature vacuum cleaners are available. In most cases, these items contain no electronic circuitry, and thus are not proper USB devices at all. This can cause problems with some computers—the USB specification requires that devices connect in a low-power mode (100 mA maximum) and state how much current they need, before switching, with the host's permission, into high-power mode.

Some devices intended for connection to laptops draw more power than is permitted by the specification for a single USB port; to avoid requiring an exernal power supply, these devices come with dual cables, and the user is instructed that the device must be plugged-into two USB ports. On a laptop with only two ports, this means only one such device can be used at a time, unless a powered hub is added. A number of peripherals for IBM laptops (now made by Lenovo) are designed to use dual USB connections in this manner.

USB-powered devices attempting to draw large currents without requesting the power will not work with certain USB controllers, and will either disrupt other devices on the bus or fail to work themselves (or both). Those problems with the abuse of the USB power supply have inspired a number of April Fool hoaxes, like the introduction of a USB-powered George Foreman iGrill [2] and a desktop USB Fondue Set [3].

同类标准比较

存储

 /
 
A Flash Drive, a typical USB mass storage device

USB implements connections to storage device using a set of standards called the USB mass storage device class. This was initially intended for traditional magnetic and optical drives, but has been extended to support a wide variety of devices. USB is not intended to be a primary bus for a computer's internal storage. Buses such as ATA (IDE) and SCSI fulfill that role.

However, USB has one important advantage in making it possible to install and remove devices without opening the computer case, making it useful for external drives. Today, a number of manufacturers offer portable USB hard drives that offer performance comparable to conventional ATA (IDE) drives. These external drives, called enclosures, are often composed of translating devices that connect to USB on one side and to conventional IDE, ATA, ATAPI, or SCSI drives on the other. You install a drive into the enclosure and then plug the enclosure into the computer; thus functioning as a regular USB mass-storage device.

FireWire technology is also commonly used with portable hard drives and some include both types of ports. FireWire tends to perform better in speed benchmark tests. However, USB ports are more common on consumer-level computers, which enhances the portability of a USB drive.

人接口设备 (HIDs)

USB has not completely replaced AT keyboard connections and PS/2 keyboard and mouse connections, but virtually all PC motherboards manufactured today have one or more USB ports. As of 2004, most new motherboards have multiple USB 2.0 high-speed ports, though some are internal, and require a "header" connection to be accessible from the front or rear of the computer case. Similarly, support for joysticks, keypads, tablets and other human-interface devices is progressively migrating from MIDI, "game", and PS/2 connectors to USB. It is now quite common for a mouse or keyboard to be a USB device, which is shipped with a small USB-to-PS/2 adaptor connected to the end of its cable, so it can be used with either USB or PS/2 ports.

Apple computers have used USB mice and keyboards exclusively since January 1999.

历史

USB

USB On-The-Go补充

扩展

The PictBridge standard allows for interconnecting consumer imaging devices. It typically uses USB as the underlying communication layer.

Microsoft's Xbox game console uses standard USB 1.1 signalling, but features a proprietary connector rather than the standard USB connector. Similarly IBM UltraPort uses standard USB signalling but provides more power to devices, and uses a proprietary connection format.

无线USB

正在开发中的一种无线数据传输标准。[4]设计标准:在3米内达到480Mbp的传输速率,在10米内达到110Mbps的传输速率。

无线USB is a promising future standard being developed to extend the USB standard while maintaining backwards compatibility with USB 1.1 and USB 2.0 on the protocol level. The USB Implementers Forum is working on a wireless networking standard based on the USB protocol. Wireless USB is intended as a cable-replacement technology, and will use Ultra wideband wireless technology for data rates of up to 480 Mbit/s. Wireless USB is well suited to wireless connection of PC centric devices, just as Bluetooth is now widely used for mobile phone centric personal networks (at much lower data rates). See http://www.usb.org/developers/wusb/ for more details.

 

[编辑本段] 【无线USB】[编辑] [顶部]

  USB开发者论坛的主席兼英特尔公司的技术策略官Jeff Ravencraft表示,无线USB技术将帮助用户在使用个人电脑连接打印机、数码相机、音乐播放器和外置磁盘驱动器等设备时,从纷繁复杂的电缆连线中 解放出来。无线USB标准的数据传输速率与目前的有线USB 2.0标准是一样的,均为每秒480M,两者的区别在于无线USB要求在个人电脑或外设中装备无线收发装置以代替电缆连线。

  在英特尔开发者论坛举办的前夕,Ravencraft称,首先采用这一标准的将是外置磁盘驱动 器、数码相机和打印机。而越来越多的产品将在今年第三季度开始推向市场。   为了使无线USB标准得以实用,必须改善这一技术的一些不足。在星期一,USB标准小组宣布了 无线联盟规范,以确保只有经过认证才能让电脑和外设通过无线USB连接起来。   Ravencraft补充,一直以来USB标准已经广泛的用于将数码相机、扫描仪、手机、 PDA、DVD刻录机和其他设备与个人电脑的连接。而无线联盟规范则详细规定了个人电脑和外设如何通过无线USB进行连接,一台电脑最多可以同时连接 127个外设。   无线联盟规范规定了两种建立连接的方法。第一种方法是电脑和外设先用电缆连接起来,然后再建立 无线连接以供以后使用。第二种方法是外设可以提供一串数字,用户在建立连接的时候输入到电脑里面。   无线USB采用超宽带技术进行通信。目前无线局域网的802.11g协议采用位于2.4GHz 附近的一小段频带进行通信,而超宽带技术则采用从3.1GHz到10.6GHz的频带进行通信。超宽带的信号水平足够低,因此对于其他无线通信技术来说, 超宽带信号的影响类似于噪声。   无线网络目前广泛使用的技术是IEEE的802.11标准,也就是英特尔所推动的Wi-Fi。 这一技术广泛的使用在笔记本电脑上,甚至部分尼康公司和佳能公司的数码相机也采用这一技术。而无线USB技术则是一个完全不同的技术,由于这一技术实现上 相对简单同时功耗只有802.11的一半,因此不少厂商都更愿意采用无线USB技术。   Ravencraft表示,在高端的手机和数码相机上采用802.11技术,关键是要解决电池 寿命问题。而厂商们发现超宽带技术是解决这一问题的最好的办法。   在距离电脑10英尺范围内,无线USB设备的传输速率将保持每秒480M。如果在30英尺范围 内,传输速率将下降到每秒110M。然而随着技术的发展,无线USB的传输速率将会超过每秒1G甚至更快。   目前超宽带技术不仅可以用于无线USB连接中,还可以在蓝牙和IEEE的1394火线连接甚至 WiNet短距离连接中使用。