Thought Leadership

USB: easy, but …

I love USB.

I have worked with PCs since The Beginning, and I remember how it used to be. I would buy new peripheral device, spend lots of time and effort ripping apart my PC to install the card and then start worrying about software, drivers etc. It took for ever. By the time I had finished, any excitement I had about this new cool device had long since evaporated.

USB changed all that. Nowadays, I just plug a standard USB cable into the back of the computer and into the device and switch on. Sometimes it will take a moment or two to figure out drivers and so forth, but in no time I am up and running.

USB has been very successful. USB 2.0 is well established and does a excellent job. With USB 3.0 beginning to appear, I look forward to great things, but it does surprise me how many people do not know how USB works…

It is not so surprising really, as USB highlights an interesting phenomenon in the high-tech world: the simpler something is to use on the outside, the more horribly complex it is on the inside! A user does not need to know about that complexity, but a developer does.

In USB terminology, a computer is a “host” and the USB connected device is a “function”. Broadly speaking, the host is in control of the communication. Any device could be a host; it does not need to be a computer. The USB software for a host and a function is different; there is either a host stack or a function stack. Some devices might need to be able to take on both roles – like a digital camera that might be a function to upload pictures to a PC, but be a host to send pictures to a printer. Such a device would need to have both host and function stacks or it could take advantage of a newer USB variant called “On The Go” [OTG], which enables devices to dynamically swap roles as required.

A USB device must fit into a “class”. There are many standard classes and it is very advantageous if a device that you are developing can be made to logically belong to one of these. On both the host side and the function, a “class driver” is required, so adherence to standard classes minimizes the developer’s work.

In some future posts, I will look in more detail at how USB works.

Most commercial embedded operating systems offer USB support [Mentor Graphics’ Nucleus being a good example], which means that even developers may be insulated from the complex details of USB implementation.

I do have a minor frustration. I cannot find USB hubs with more than 7 ports. Also the sockets tend to be too close together, which is a problem with “chunky” things like USB drives. If anyone know where I can get a powered hub with, say, 20 ports and a bit of space around the sockets, please email me.

Colin Walls

I have over thirty years experience in the electronics industry, largely dedicated to embedded software. A frequent presenter at conferences and seminars and author of numerous technical articles and two books on embedded software, I am a member of the marketing team of the Mentor Graphics Embedded Systems Division, and am based in the UK. Away from work, I have a wide range of interests including photography and trying to point my two daughters in the right direction in life. Learn more about Colin, including his go-to karaoke song and the best parts of being British: http://go.mentor.com/3_acv

More from this author

Comments

0 thoughts about “USB: easy, but …
  • USB is really a remarkable invention. and I like intel’s tv ad “our heroes are different then your heroes: Vijay Bhatt : Co-founder of USB”

Leave a Reply

This article first appeared on the Siemens Digital Industries Software blog at https://blogs.sw.siemens.com/embedded-software/2009/08/03/usb-easy-but/