{"id":1170,"date":"2010-11-01T10:40:17","date_gmt":"2010-11-01T09:40:17","guid":{"rendered":"https:\/\/blogs.mentor.com\/colinwalls\/?p=1170"},"modified":"2026-03-26T16:33:25","modified_gmt":"2026-03-26T20:33:25","slug":"usb-even-more","status":"publish","type":"post","link":"https:\/\/blogs.sw.siemens.com\/embedded-software\/2010\/11\/01\/usb-even-more\/","title":{"rendered":"USB &#8211; even more"},"content":{"rendered":"<p>I have written about USB many times &#8211; <a href=\"https:\/\/blogs.mentor.com\/colinwalls\/blog\/2009\/08\/03\/usb-easy-but\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>, <a href=\"https:\/\/blogs.mentor.com\/colinwalls\/blog\/2010\/08\/16\/usb-%e2%80%93-the-need-for-speed\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> and <a href=\"https:\/\/blogs.mentor.com\/colinwalls\/blog\/2010\/09\/13\/usb-real-speed\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>, for example &#8211; and get a good response. Downloads of <a href=\"http:\/\/www.mentor.com\/embedded-software\/resources\/overview\/usb-explained-an-introduction-to-usb-and-its-future-0ab43faa-66f6-4471-9408-8b386f5e74c8\" target=\"_blank\" rel=\"noopener noreferrer\">technical papers<\/a> and <a href=\"http:\/\/www.mentor.com\/embedded-software\/multimedia\/usb-under-the-hood-webinar\" target=\"_blank\" rel=\"noopener noreferrer\">web seminar<\/a> attendances seem to break all records. It is clearly a topic of interest to many embedded developers. This is hardly surprising, as it is rare for any electronic device nowadays not to sport a USB interface. If you want a wired connection that just works, USB is an easy choice.<\/p>\n<p>This ease of use comes at a price. The internal functions of USB are quite complex. This does not matter at all to the average user, but to the software developer of a USB-enabled device, it matters a lot. Even if a commercial <a href=\"http:\/\/www.mentor.com\/embedded-software\/nucleus\/usb\" target=\"_blank\" rel=\"noopener noreferrer\">USB stack<\/a> is employed [which, naturally, I advocate and urge you to ensure that it is fully certified for standards compliance], having an understanding of the internals is useful to obtain the maximum performance and functionality. Today I want to talk about Endpoints, Pipes and Interfaces &#8230;<!--more--><\/p>\n<p>A USB connection between two devices [or between a computer and a peripheral &#8211; in the USB jargon, between a host and a function] is usually just 4 wires [prior to USB 3, which has 9 wires]. This is not important unless you are making cables and connectors, as, from a usage\/software perspective, this connection carries a number of logical channels of communication or <strong>Pipes<\/strong>. A USB interface is configured to include a number [up to 32 &#8211; 16 IN and 16 OUT] <strong>Endpoints<\/strong>. These are the logical termination points of a pipe. As I mentioned on a previous occasion, USB communications may be performed using one of four modes: control, bulk, interrupt or isochronous. The endpoints are each characterized to support a single one of these modes.<\/p>\n<p>An endpoint is normally part of the electronics hardware, with a set of registers set up by the USB stack. It is configured when the USB software is initialized. A pipe is a purely logical entity, which does not exist until a connection between two endpoints is established.<\/p>\n<p>A USB enabled device can support a number of configurations. For each configuration, a number endpoints may be grouped into an <strong>Interface<\/strong>, which is associated with a specific function or purpose of a device and will use some or all of the endpoints. All the interfaces associated with a configuration can be set at the same time, so it is not possible to use the same endpoints for different interfaces. The first endpoint [Endpoint 0, which is actually a pair &#8211; IN and OUT] is exceptional, as it does not belong to an interface, but is used specifically for device configuration. A simple device will tend to have a single interface. A very simple device may only have a single endpoint [Endpoint 0, of course]. USB hubs also have a single endpoint.<\/p>\n<p>I acknowledge the assistance I gratefully received from my colleague Stephen Olsen, who helped me get all of my terminology and concepts reasonably straight.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have written about USB many times &#8211; here, here and here, for example &#8211; and get a good response&#8230;.<\/p>\n","protected":false},"author":71677,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spanish_translation":"","french_translation":"","german_translation":"","italian_translation":"","polish_translation":"","japanese_translation":"","chinese_translation":"","footnotes":""},"categories":[1],"tags":[300,326],"industry":[],"product":[],"coauthors":[],"class_list":["post-1170","post","type-post","status-publish","format-standard","hentry","category-news","tag-embedded-software","tag-usb"],"_links":{"self":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/1170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/users\/71677"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/comments?post=1170"}],"version-history":[{"count":1,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/1170\/revisions"}],"predecessor-version":[{"id":9902,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/1170\/revisions\/9902"}],"wp:attachment":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/media?parent=1170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/categories?post=1170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/tags?post=1170"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/industry?post=1170"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/product?post=1170"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/coauthors?post=1170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}