I also recommend USB Made Simple [1], which has similar vibe to this site, but also includes USB 2.0 description and is a bit more detailed on electrical/low level aspects.
For an actual implementation, see V-USB [2] - surprisingly readable software library for bit-banging USB on AVR (Arduino/ATTiny/ATMega)
2010, when USB was still relatively simple (3.0 had just came out, and it and subsequent revisions is when things started to get really crazy) and many more websites were still highly readable documents like this one.
I just recently had to read this to understand enough to implement a USB device on a PIC32, but there's still some more clarifying info I'd like to see.
For example, there's almost no information anywhere online on how the polling is supposed to work for noticing interrupt requests from the device. Is this typically handled at the OS level and the application writer does not mess with it? I still don't know.
The reason I ask is because while trying to implement USB on my PIC32, I observed USB traffic via wireshark of another third party custom HID device that I was trying to mimic. This device, once you pressed a button on it, wireshark would show INTERRUPT IN requests coming from the device, without any programs open. However with my own USB device implementation, I couldn't get this to happen, no matter how hard I tried. I just happen to try opening the USB device from an application and trying to read from it, at which point my interrupt IN transfers magically showed up in wireshark and starting working. I still don't understand why that's necessary when my third-party device can do it all by itself.
Many years ago family member asked me how to transfer photos from their Symbian phone onto PC. Over the years they have been conditioned to absolutely never plug or unplug anything from the computer while it is turned on. It took quite some time to convince them that USB is designed for hotplugging. But the moment we connect it, computer totally freezes. With egg on my face I think, oh, probably just Windows XP crashed. Power-cycling doesn't help at all though, no POST, no beeps, absolutely nothing. Out of ideas I open the computer case, only to see there's a huge bulge on the chipset...
I have no idea what happened there. Perhaps unlucky short when inserting connector, causing latch-up in the chip? Phone was totally fine after this, I connected it to different PC without issues.
"Every computer where I've replugged a ps/2 mouse, it worked just fine."
PS/2 is not a hot-swappable port, by design. Your hot-swap adventures mean you started out using more modern motherboards (2010-ish) which simply have an internal USB-PS/2 adapter for presenting PS/2 ports.
Ahh, the good ole days. I remember having an IRQ conflict between my 2400 baud modem and my serial connected mouse. I had to keep moving my mouse to use the modem until I changed one of the IRQs.
Great callout. To me the biggest revolution came from USB mass storage devices. You either juggled 1.44MB floppy disks around, had to use CD-ROMs, or you had to open up your desktop and plug in a HDD.
With USB, all you had to do was stick a small plastic widget in a USB socket and you were ready to go. How cool is that?
Flash memory hammered home we lived in the future. Some USB flash drives fitted right into a USB type A plug, and stored hundreds of megabytes.
Regarding the article date, I'm pretty sure this is older than 2010, with the description of USB 2.0 as new and poorly adopted (USB 2.0 was released in 2000, 3.0 in 2008)
USB is surprisingly simple. Not very simple, but it’s possible for a determined developer to understand and implement driver within a reasonable amount of time. At least early versions. Before I dive into it, I thought it was complete magic.
I've written a device and driver side USB stack, not even bare metal and it took several weeks of attempts and hundreds of pages of reading (mostly USB complete by Jan Axelson, this site is also good but just not as in-depth) to get right and there are still parts of it I don't fully understand.
Call it 15 hours to get a "ping" signal across, and another 15 to get data travelling at full speed with proper SOF handling.
Nowhere near as simple as something like I2C that you can get a complete understanding of in an afternoon.
Its even more complicated now. USB4 has a lot of timing related things that the system has to do before you can even start sending data. More complicated, much of it is done in hardware, which might be nice for quickly slapping USB capabilities, buttttt is a bear if you're trying to build something thats not a computer. Theres cases where the device wont even power on unless you do everything just right hardware side. Gone are the days of simple signals and connections.
I'd estimate it as few months of full work for my abilities. Though it depends on underlying hardware, as you inevitably will work with some existing chips which simplify (or complicate) some matters.
I am trying to add usb floppy support for the esp32 host and this site is helping me a lot.
The current esp32 mass storage driver supports only bulk only transfer scsi, but usb floppies (those with the uf001f chip) use CBI(control/bulk/interrupt) and also UFI has a bit different command set: https://www.usb.org/sites/default/files/usbmass-ufi10.pdf
By using this site, a cheap logic analyzer and usbpcap for windows, I am trying to go around reading all the usb docs :)
Reading and understanding documentation is a true waste of time. I just press the ‘I can has usb?’ Button and it lays works well enough for me to sell to people.
For an actual implementation, see V-USB [2] - surprisingly readable software library for bit-banging USB on AVR (Arduino/ATTiny/ATMega)
[1] https://www.usbmadesimple.co.uk/index.html
[2] https://github.com/obdev/v-usb