The USB Protocol, Explained

If you can explain what a USB PID, a J state, a K state, and an SOF are, you can probably stop reading now. But if you don’t know or you want a refresher, you can spend 15 minutes watching [Sine Lab’s] straightforward explanation of the USB protocol details. You can find the video below.

The motivation for this is he wants to add USB to his projects using an ATMega with a hardware USB implementation. Honestly, most of the time, you’ll just consume some premade library and get it working that way. However, understanding the terminology can help you, especially if things don’t go as planned.

Of course, another useful method is to just use a canned USB “serial port” and treat the whole thing like an old-fashioned serial port. But for some things you do want to take advantage of the speed and capabilities of the USB specification.

The last few minutes of the video get to a practical example. We agree with the decision to use a library, and in this case, he uses LUFA, an open-source USB stack for the processor he wants to use. But understanding the actual protocol will help you make sense of the documentation and troubleshoot. The example uses a HID device, which is yet more protocol you’ll have to read up on separately.

If you want to learn more about USB-C, [Arya Voronova’s] got you covered. The CDC USB profile can support multiple serial ports, but if you’d rather abuse a single serial port to get multiple virtual ports, that’s possible, too.

8 thoughts on “The USB Protocol, Explained

  1. Doesn’t seem that hard to understand to me.
    Now the US president on the other hand…
    And the vice president is very hard to listen to too, although that is mostly the sort of nasal pronunciation.
    And these examples were not political BTW, I only mention them because they are well known and good examples.
    Oddly there seem to be quite a few politicians of all sides and all kinds of parties who are very poor speakers and hard to understand, and yet get voted for. Makes you wonder if any message is needed at all. Or perhaps, if you are a very positive person, you can assume the voters read the message of those politicians, or listen to 3rd parties explaining them.

Leave a Reply to cdillaCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.