Universal Serial Bus: Difference between revisions

Jump to navigation Jump to search
rewrote supporting usb section, renamed it to introduction, moved it up. fixed some typos and grammatical errors, added links from article to the links section, removed irrelevant links
[unchecked revision][unchecked revision]
m (Corrected small typo)
(rewrote supporting usb section, renamed it to introduction, moved it up. fixed some typos and grammatical errors, added links from article to the links section, removed irrelevant links)
Line 1:
The Universal Serial Bus was first introduced in 1994 with the intention of replacing various specialized interfaces, and to simplify the configuration of communication devices. The communication industry did not develop as the USB-IF foresaw, but the various transfer modes that USB introduced allowed it to become one of the most popular standards in use today. Virtually every modern computer supports USB.
 
== Introduction ==
Despite how attractive USB support is, the 650-page USB 2.0 specification manages to deter even some of the most driven hobbyists (especially if English isn't a his/her primary language). Not only is the USB 2.0 specification long, but it's a prerequisite for the EHCI, UHCI, and OHCI specifications, all of which must be implemented for full USB 2.0 support. Furthermore, the USB specification defines a plethora of terms, some used interchangeably and seemingly lazily; as a lengthy technical document, it is neither easy nor practical to flip back and forth to clarify a confusing term or concept.
 
=== What this text covers ===
The truth is that youa donsoftware developer doesn't need to read the entire USB 2.0 specification; there are sections specific to hardware developers, for example. The information presented here attempts to summarize chapters 4, 5, and 8 through 11, but reading those sections of the specification is recommended10.
 
Chapter 11 is specific to hubs and is also essential for a full USB 2.0 implementation, however it is almost as long as chapters 4, 5, 8, 9, and 10 combined, and could be regarded as the documentation for a specific (albeit special) class of USB devices. Chapter 11 is covered thusly in its own wiki entry, [[USB Hubs]]. Even so, some concepts which pertain to USB hubs are briefly discussed where relevant in this article.
 
Ideally, the text here will establish familiarity with the terms and concepts that a hobby OS developer needs to begin implementing USB support and, if necessary, easily parse the USB specification without becoming intimidated by the amount of information. At the very least, the system programmer should keep a copy of the USB 2.0 specification for reference while working with USB-related hardware.
 
Fortunately, all of the necessary documentation is available for free:
* [http://www.usb.org/developers/docs/usb_20_052709.zip USB 2.0 Specifications]
* [http://www.intel.com/technology/usb/download/ehci-r10.pdf EHCI Specifications]
* [http://download.intel.com/technology/usb/UHCI11D.pdf UHCI Specifications]
* [http://www.o3one.org/hwdocs/usb/hcir1_0a.pdf OHCI Specifications]
 
=== What this text does not cover ===
Please note that USB, unlike other standards like [[VGA]] or [[PCI]], is agnostic of the hardware interface to the system bus (and, by extension, to the operating system). Such an interface is provided by one or more [[#Host_Controllers|USB host controllers]] and is defined by the appropriate documentation. Therefore, one should not expect this text to discuss specifics or code samples (e.g., as one finds in the wiki entries about [[VGA]] or [[PCI]]) detailing how the operating system initiates and maintains communication with USB devices. Although such information may be found on wiki entries discussing a particular [[#Host_Controller_Driver|Host Controller Driver]], those wiki entries assume an understanding of the concepts and terms discussed here.
 
== Host Controllers ==
Line 15 ⟶ 34:
In designing USB 2.0, the USB-IF insisted on a single implementation. That single implementation is Intel's '''Extended Host Controller Interface''' ('''EHCI'''). However, even though the USB 2.0 specification requires that a USB 2.0 interface support USB 1.0 devices, this doesn't mean that the EHCI must support USB 1.0 devices, and in fact, it doesn't. Each EHCI host controller is accompanied by (usually several) UHCI and/or OHCI host controllers. When a USB 1.0 device is attached, the EHCI simply hands control over to a '''companion controller'''. Refer to figure 1 for a simple block diagram implementation of this behavior. Therefore, the system programmer must support all three standards in order to support USB 2.0.
 
The EHCI host controller only handles USB 1.0 devices if they are attached indirectly through a USB 2.0 hub. The specifics of handling USB 1.0 devices attached to a USB 2.0 hub are briefly discussed and illustrated in the [[#Hubs|hubs]] section, and in more detail underin [[#Splitthe Transactions|Splitwiki Transactions]entry for [USB Hubs]
 
'''Specifications'''
Line 25 ⟶ 44:
'''Specifications'''
* [http://www.usb.org/developers/docs/usb_30_spec_052109.zip USB 3.0 Specifications]
 
== Supporting USB ==
Despite how attractive USB support is, the 650-page USB 2.0 specification manages to deter even some of the most driven hobbyists (especially if English isn't a his/her primary language). Not only is the USB 2.0 specification long, but it's a prerequisite for the EHCI, UHCI, and OHCI specifications, all of which must be implemented for full USB 2.0 support.
 
The truth is that you don't need to read the entire USB 2.0 specification; there are sections specific to hardware developers, for example. The information presented here attempts to summarize chapters 4, 5, and 8 through 11, but reading those sections of the specification is recommended.
 
On the other hand, the specifications were not written to simply take up space. The USB architecture is relatively extensive and can only be summarized so much. At the very least, the system programmer should keep a copy of the USB 2.0 specifications to reference when he/she is unsure about something. Hopefully the information here will also make the specifications easier to understand, as some terms can be confusing at first.
 
Fortunately, all of the necessary documentation is available for free:
* [http://www.usb.org/developers/docs/usb_20_052709.zip USB 2.0 Specifications]
* [http://www.intel.com/technology/usb/download/ehci-r10.pdf EHCI Specifications]
* [http://download.intel.com/technology/usb/UHCI11D.pdf UHCI Specifications]
* [http://www.o3one.org/hwdocs/usb/hcir1_0a.pdf OHCI Specifications]
 
== Basic Concepts and Nomenclature ==
Line 73 ⟶ 79:
</gallery>
 
<!--
[[Image:LFSpeedDevToHSPort.gif|thumb|left|Figure 3: Low- or Full-speed device connected to a high-speed capable USB port]]
[[Image:HSHubToHSPort.gif|thumb|Figure 4: High-speed hub connected to a high-speed capable USB port]]
[[Image:HSDevsToHSHubToHSPort.gif|thumb|none|Figure 5: High-speed devices connected to a high-speed hub which is connected to a high-speed USB port]][[Image:LFHSDevsHSHubHSPortIncorrect.gif|thumb|none|Figure 6: Incorrect illustration of Low- and Full-speed devices on a high-speed bus]][[Image:LFHSDevsHSHubHSPortCorrect.gif|thumb|none|Figure 7: Correct illustration of split transactions allowing Low- and Full-speed devices on a high-speed bus]]
-->
[[Image:USBTopology.gif|thumb|right|Figure 8: USB Topology]]
==== USB Interconnect ====
Line 107 ⟶ 108:
Besides the two required endpoints, functions may implement additional endpoints as necessary, with the following limitations:
* Low-speed functions may implement up to two additional endpoints.
* Full- and high-speed devices may implement up to 15 additional input endpoints and 15 additional output endpoints. TheThis reasonsis fora thisphysical limitlimitation willof bethe clearUSB laterprotocol onand is discussed under [[#Endpoint_field|Endpoint_Field]].
 
==== Endpoint Zero ====
Line 267 ⟶ 268:
 
==== Bus Time Rationing ====
There are separate rules for the allocation of frames on a full- or /low-speed bus, and for the rules for allocation of microframes on a high-speed bus.
 
For full- or low- speed buses:
Line 1,937 ⟶ 1,938:
 
==== STRING ====
Devices may optionally support STRING descriptors. If a device does not support STRING descriptors, any field which references the index of a STRING descriptor must be reset to zero. STRING descriptors use unicode encodings and may support multiple languages. The host requests a STRING descriptor with the [[#GET_DESCRIPTOR|GET_DECRIPTOR]] request and must pass the 16-bit LANGID (as defined by the USB-IF) of the desired language in the ''wIndex'' field. The list of currently accepted LANGIDs is located [[http://www.usb.org/developers/docs/USB_LANGIDs.pdf| here]].
 
String index 0 for all languages returns a STRING descriptor that contains an array of all the two-byte LANGID codes that the device supports.
Line 2,048 ⟶ 2,049:
* [http://www.usb.org/home USB.org]
* [http://www.usb.org/developers/docs/usb_20_052709.zip USB 2.0 Specifications]
* [http://www.usb.org/developers/hidpage/ information about the HID standard].
* [http://www.kernel.org/ The Linux kernel] (though things tends to be confusing there, and you have to be careful with educating yourself from Linux sources if your project isn't GPL'ed).
* In [http://developer.intel.com/ Intel] chipsets manuals.
* [http://www.beyondlogic.org/usbnutshell/usb1.htm USB in a Nutshell] may also interest you. It looks like a really good tutorial giving all the required knowledge to understand any other USB documentation/source code in a couple of HTML pages ...
* [http://www.usb.org/developers/docs/USB_LANGIDs.pdf Currently accepted LANGIDs]
* '''Host Controller Documentation:'''
** [http://www.intel.com/technology/usb/download/ehci-r10.pdf EHCI Specifications]
** [http://download.intel.com/technology/usb/UHCI11D.pdf UHCI Specifications]
** [http://www.o3one.org/hwdocs/usb/hcir1_0a.pdf OHCI Specifications]
 
=== Forum Topics ===
* [[Topic:8096|USB driver]] - suggests a few startup links about USB
* [[Topic:8692|support USB keyboard]] explained by Schol-R-Lea
* [[Topic:9063|Collecting links about USB]] - PypeClicker and Df's collection of links about USB
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu