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”
Next up tackle the Bluetooth stack.
… summarizing a light evening reading in an article? :)
That Zero Insertion Force (ZIF) SMD Adapter is crazy expensive! Instead it’s better to use an SMD break-out PC board that costs less than a buck. The 32-TQFP SMD break-out PCB for the ATMEGA16U2-AUR micro costs $0.80 USD each.
1. SMD Adapters
2. 32 pin TQFP SMD Adapter
It’s for people who can’t (don’t know) how to solder that fine of a pitch.
Nice timing. This morning my wife asked me what USB was all about. No idea why. She seemed to loose interest after five minutes or so. I’ll send her this link and see whether this helps :-)
Nice video but the accent makes it a bit hard to understand some words. Is that valley “girl” accent?
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.
He definitely slurs some words, and abbreviations, but it’s a hobby channel so it’s not the main focus.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)