USB 2 is the USB we all know and love. But about ten years ago, USB got an upgrade: USB 3.0. And it’s a lot faster. It started off ten times the speed of USB 2, with 5 Gbps, and later got 20 Gbps and 40 Gbps revisions. How does that work, and how do you hack on it? Well, for a start, it’s very different from USB 2, and the hacking differs in many important ways.
In fact, USB 3 is an entirely separate interface from USB 2, and it does not depend on USB 2 in any way whatsoever – some people think that USB 3 negotiation happens through USB 2, but that’s a complete myth. USB 2 and USB 3 are electrically, physically, and logically distinct interfaces. Except for the fact that USB 3 is backwards compatible with USB 2, they are simply entirely different.
This also means that every USB-A port with USB 3 capabilities (typically blue, but not always) carries two interfaces; indeed, if you want, you can split a typical USB 3 port into a USB 3-only USB-A port and a USB 2-only USB-A port. USB 3-only ports are not legal per USB 3 standard, you’re expected to keep USB 2 there, but only for user convenience; you can split it with a hub and get, like, three extra USB 2 branches for your own use. Even if it’s forbidden, it works flawlessly – it’s what I’m currently using to connect my mouse to my laptop as I’m typing this!
Not to say that USB 3 is all easy to work with – there’s a fair bit of complexity.
For A More Civilized Age
USB 3 is fully differential, and full duplex. It’s still point-to-point, but unlike USB 2 with its pseudodifferential half-duplex transmitters, there are two differential pairs – one RX, one TX. It’s like UART: TX on one end connects to RX on the other end, RX connects to TX, so the two pairs have to be crossed over, typically, inside the cable – for instance, high-speed USB-C cables have the USB 3-intended pairs crossed-over by default! Oh, and you have to put series capacitors on each end, at each TX output.
In this way, USB 3 physical layer is just like PCIe; in fact, it can be done using basically the same hardware inside the chip! The routing requirements are tougher than USB 2, so you really want to make sure the tracks are impedance-matched, and use a four-layer PCB instead of a two-layer one. Wondering about routing USB 3? Refer to my guide on routing PCIe, keeping the above restrictions in mind. Here’s a bonus – unlike USB 2, you can flip the pair polarity for ease of routing!
Device detection isn’t done with resistors – instead, the USB 3 peripheral produces regular pulses on the TX pair, known as LPFS mode, and the peripheral on the other end listens to the RX pair for these pulses. That’s also how polarity flips get compensated for.
There are no resistors to add, though if you want to connect different USB 3 devices on your board, you might need to take care of some common mode level matching every now and then, like niconico shows us in detail in the extensive readme for their wonderful PCB housing a USB 2 – USB 3 transaction translator.
Just like PCIe, you’re not expected to handle USB 3 yourself. Unlike USB 2, you can’t quite hand-wire it either – there are products of Eastern manufacture that do, and the failures are quite prominent. If you are shopping for USB 3 hubs and find one with a captive cable, be careful – it might be wired in a lax way, neglecting USB 3 requirements, and you won’t be able to fix it without buying a new hub. Better stick to USB 3 hubs equipped with microUSB3 and USB-C ports!
If you want your links to work guaranteed, don’t hand-wire them, rather, use impedance-matched traces on your PCB as much as possible, PCB track quality really matters here, and could easily limit your speed; even big companies might screw it up!
For instance, [WifiCable] has tinkered on a laptop with USB 3 ports limited to 5 Gbps mode by a chipset setting, and once the setting was unlocked, the ports would negotiate 10 Gbps mode, but had constant stability issues. I’ve also seen Dell route a USB 3 link over an FPC, only to get stability issues with certain kinds of hubs.
The Three Versions
You might have heard of the USB 3 naming shenanigans, with like fifteen different names and logos used to refer to different USB3 versions – like USB 3.0 USB 3.1, USB 3.1 Gen 2, USB 3.2, and so on. I am pleased to inform you there are only three versions – the dozen different names and logos are duplicates of each other, a marketing strategy that confused people more than it helped, nothing more. If you want to learn more about how it came, you can read here, but let’s be fair, you likely don’t need to know that.
There are only three USB 3 versions as far as cold hard hacking is concerned – you can refer to them as 5 Gbps, 10 Gbps, and 20 Gbps. The 10G bps is just 5 Gbps but overclocked in a few different ways. The 20 Gbps version requires USB-C, and, to simplify it, is like two USB 3 links ganged together. You can’t just put two links together to get 20 Gbps mode, though – it does require a different USB 3 peripheral, and it doesn’t work like two USB3 links, even though it has backwards compatibility.
As for matters more physical, there’s four different connectors you will see USB 3 on – USB-A, USB-B, microUSB 3, and USB-C, each of them getting extra two pairs of pins, and, for the first three, an extra GND pin. This GND line helps provide a more stable ground reference, is perhaps not as much encumbered by the ground current, and with the GND pin placed between the two pairs, it helps prevent crosstalk. USB-A is used on hosts, USB-B and microUSB3 are mainstays on devices, and USB-C, in its universality, can be used everywhere.
On some devices of Eastern manufacture, in the dark days before USB-C, you might have seen USB-A used as a device port, and the devices would come bundled with the forbidden USB A-to-A cable. MicroUSB3 has the reputation for being finicky, and USB-B 3 is quite bulky, to the point where not all devices could even afford the added height. If you’re in a pinch and you need a USB 3 device port, you can still use USB-A – people will call it cursed, but you might as well wear this badge proudly.
Nowadays, if USB-C isn’t an option because you can’t be bothered to find a mux, a device with microUSB3 would be my second choice. The trick is to buy a few USB-C to microUSB3 cables on Aliexpress. I swear by them, and if you have some microUSB3 devices at home, you should grab two or three cables like that and never worry about microUSB3 again. Not that the forbidden A-A cable is hard to find nowadays, either!
Last thing to mention is, you might see USB 3 cables and sockets in an initially unexpected place – carrying a PCIe x1 link, again, in hardware of Eastern design. USB 3 cables are only used there for the extra lines: USB 2 pins carry REFCLK, and the two high-speed pairs carry, DRAIN typically carries GND, and the USB2 VBUS and GND tend to carry two PCIe link management signals.
This is an unspoken standard across Eastern vendors of many PCIe accessories – you might see slight pinout variations, but nothing too major. Honestly, I respect that a lot, I’ve recommended it to my hardware hacker friends as a way to expose PCIe, and it’s something that I believe is a decent option, especially given the abundance of hardware that uses USB 3 connectors for PCIe. Is it standards compliant? No. Could someone call it cursed? Yes. Is it a viable way to carry a PCIe x1 link? Also yes. Is it easy to implement? Yes, again. Is it cheap? Without a doubt. If you really need x4 and guaranteed high speeds, you might want to go for Oculink, but until then, the abusing USB 3 hardware will do just fine.
There’s more I could say about USB 3, but for now, I hope this is more than sufficient for you to wade through USB 3 waters, for whatever hacks and projects you might be exploring. Got questions, corrections, or advice? Ever make something cool with USB 3? Tell us all in the comments down below!
thanks – the existence of USB-A 3 and USB-B 3 and microUSB 3 is news to me. stared at the USB-A photo with the extra pins for a good long while before i could believe it wasn’t an AI-generated joke! reminds me of the cheap camera i have with a combined male usb-a / microusb connector. kind of unsettling. i like to think i could have gone my whole life without learning about USB-A 3, and i hope by the time i die i may yet feel like i’ve accomplished that
i’m not sure the downsides of USB-C but in user devices i like it at least as well as i liked microusb before it. especially given i can still just use microusb if i want to
“combined male usb-a / microusb connector” Wait what?
I do have a device that has a female micro-usb-a/b connector. They are basically the same, with the female micro b what most of us know (the USB on phones before USB-C) and USB-A the same but with square corners instead of 2 diagonal ones. A female-micro-usb-a-receptable will fit a usb-micro-b cable. They are “illegal” ports, but are used fairly often on e-bikes and UPS’es, where they can be used both in client mode (attached to a computer with a normal cable) to change the bike’s settings or firmware, but also as a “host” (charge only) to charge attached devices with a male-usb-micro-a (or b) to male-usb-b-micro cable.
haha
https://galexander.org/x/usb-a-micro.jpg
the usb-a part is hinged at the base of the metal and flips back to reveal the embedded micro usb
Wow! This is whole more levels of cursed than the combined SD-card / flip back to become USB-A: https://commons.wikimedia.org/wiki/File:USB-SD-Cards.jpg (or the actual standard of USBA+24V Power https://en.wikipedia.org/wiki/PoweredUSB)
I think rule 34 should be amended to “There is a connector for that”
(Looks at the .jpg, mind almost bursts!)
Like you, I didn’t know about the USB-A connector with the extra pins!
I have a cheap endoscope with a similar looking connector, but I think the not-A part might be C rather than micro.
“On some devices of Eastern manufacture, in the dark days before USB-C, you might have seen USB-A used as a device port, and the devices would come bundled with the forbidden USB A-to-A cable.”
Oh ho ho, it ain’t just Eastern manufacture.
In aerospace/military/etc., the “circular connector” or “mil-spec” standard that is essentially D38999 also resulted in a bunch of manufacturers using the same connector sizes for “non-standard” mil-specs, like Ethernet or USB.
So you get these “mil-spec style USB connectors” from a ton of the ‘standard’ vendors (Glenair, Amphenol, etc.). They’re super-pricey, too, like $100+ (as high as $500+!). And some of them are bulkhead feedthroughs, so USB connectors on both sides.
And you know what they all are? A to A. Yes. Seriously. Military precision, there.
Ooh, I found a nice link!
https://www.digikey.com/en/product-highlight/a/amphenol-pcd/usbftv-and-usb3ftv-ruggedized-usb-connectors
Go glance through. Literally everything is USB type A. Bulkhead feedthroughs are A to A (or A to 4 pins), literally all the cables are A to A, everything. And some of these are even USB3 Type A-to-A! Some are A receptacle to A plug, so that’s not horrible, but overall it’s like they looked at the USB standard and said “nope.”
Thanks for the link!
(I wouldn’t have believed you without it j/k!)
i believe i have had exactly two devices that were a-to-a. one was a cheap avr programmer. the other was the archos media player i had 20+ years ago. i can understand the former, but not the latter.
If USB 3-only ports are not legal per USB 3 standard, what about USB3 with USB1 ?
(some IC’s only implement USB1, because of the diespace useage for USB2)
and is USBC CC-pin backwards compatible with micro-USBs USB-ID pin?
Also is the algoritm for 128b/132b is somehow compatible with 128b/130b? and 64b66b? and 8b10b?
and is PAM-2/NRZ, PAM-3 ,PAM-4 and PAM-16 related enough to be combined to one hardware unit?
or does they all require defferent hardware implementations?
“USB1” is a subset of USB2, that’s the whole “USB2 full-speed/low-speed” thing. USB2 100% includes devices that are FS/LS only.
“and is USBC CC-pin backwards compatible with micro-USBs USB-ID pin?”
No, not in the slightest.
USB3&USB1: don’t know about the standard, but nothing would restrict it in practice for sure. As for ID pin – no, sadly, the ID pin is a mishmash of simple open and complicated proprietary signaling, so I gotta say it’s best left in the past.
I never knew it was called microUSB3. We got external 2.5″ SATA drives with those connectors and never knew the name. Learned something new today!
The USB standard has become very confusing. I’m glad I don’t use it all that much. Especially when trying to do things like connect monitors or support high-power devices, it can get very unclear which devices work in which ways. For a while, I was looking for a way to move my computers further from my workstation, maybe into a cabinet or another room, but it seems that’s not possible at a reasonable price. Once you start looking into 10-meter cables to connect multiple monitors, it becomes a real challenge.
P.S. It was confusing to see eastern written as Eastern given the context. I first assumed it was about a company named Eastern so I was already googling that. Reminds me of an old English lessons though. “Anything eastern of Lubeck is Eastern Europe”. Not trying to be annoying, just hope it helps other people who got confused.
“but it seems that’s not possible at a reasonable price. Once you start looking into 10-meter cables”
This isn’t a USB problem, it’s a bandwidth problem. You’re trying to push gigabits/sec over tens of meters, that’s always going to be a challenge. USB Type C, HDMI, DisplayPort, whatever, pretty much anything over 10+ ft-ish is going to Be Hard (not impossible, it’s totally doable, but it’s not surprising when 5+ meter cables don’t work for certain devices). Ethernet spoils you because there’s sooo much more going on inside the PHYs.
Basically USB before USB C is golden. If the connector fits and the color matches, it will work, but might work at slower speeds.
With USB C you need the right combination of two devices and cable, and there is NO way to tell (without testing equipment) whether they are the right combination.
Usually there are cryptic glyphs, but now it says “USB4”.
It gets worse. I have an HP BlizzardU motherboard here with dual USB4 ports, and even HPs (now removed, thank you Archive .org) website says it has no support for onboard video output. Well guess what, the top connector has DisplayPort Alt mode. Which is good because the BIOS will only display a white screen on a normal video card. Seems to be an HP thing, had an AM5 HP board doing the same thing last month.
Also thanks a lot, I forked over $8 to Amazon and I’ll have a pair of USB3 to USB2 and 3 breakout cables
Hey, dont blame archive.org for problems being caused by malicious persons from outside, nor the ones caused by our fake-azz “supreme” court.
“If the connector fits and the color matches, it will work, but might work at slower speeds.”
Almost. USB OTG started to break things because there’s nothing stopping you from plugging in an OTG cable in and hooking up, say, a mouse to a mouse, and that ain’t gonna do crap.
USB started off as “two separate port types, but it’ll always work” and it eventually evolved into “one port type to rule them all but only a chance it’ll work.”
” hooking up, say, a mouse to a mouse, and that ain’t gonna do crap.”
Well, at least the mice might be happy!
B^)
“plugging a mouse into a mouse doesn’t work” is a funny standard for what to consider a failure mode
Not that intense in the slightest. Most USB-C devices are charging-only or USB-2 only, so any cable works, and any host port will do. If it’s a device that does high-speed data transfer, use a thick cable that does like Thunderbolt or DisplayPort, and make sure your host port can do these. If it’s about charging or powering high-power devices (over 60W, laptops and such), you pick a cable that can do 100W or 240W. Know no fear c:
“I never knew it was called microUSB3. We got external 2.5″ SATA drives with those connectors and never knew the name. ”
I also had a SwampScum Galaxy phone that used them as well, I’m not sure if it charged any faster with it.
I used a Galaxy S5 with a microUSB3 port, it didn’t seem to charge any faster (no reason it would, either), but it did support 5Gbps USB connections! so there’s that
so does my USB hub with a USB B 3 (I thought it was a non-spec B port for lock in, lol) have a separate 2.0 and 3.0 hub inside?
yeah, though typically they’re put inside the same IC.
Are there any microcontrollers below EUR 10 that can do > 480Mbps USB?
The Cypress CY7C68013A (Popular in the ubiquitous 8ch 24MHz Logic Analyzer) “only” goes up to 480Mbps, and the FX3 is quite a lot more expensive.
All this talk about higher speed USB is nice, but as long as it’s difficult to obtain affordable hardware, it’s not so much fun to experiment with it.
A bit similar with 10Gbps Ethernet. It has been available for 10 or so years, but it’s still quite expensive. I just had a look and apparently a 10Gbps switch is about 20x more costly then a 1Gbps switch, and I find it hard to believe that would be the “real” cost, instead of some inflated cartel conspiracy thing.
” I just had a look and apparently a 10Gbps switch is about 20x more costly then a 1Gbps switch, and I find it hard to believe that would be the “real” cost”
I don’t. Analog-wise the requirements for 10 GbE are pretty much 10x+ the cost of gigabit ethernet, since GbE basically hits the limit of single ADCs per channel.
And then for a switch, if you just look at shuffling bits around after the PHY, a RGMII interface takes just 14 pins, with data DDR at 125 MHz: you could build a gigabit switch with a pretty cheap FPGA. 10 GbE switches basically require decent SerDeses, or nearly 6x the pin count, and including a SerDes is a significant jump complexity-wise.
There are FPGA Ethernet switch (NetFPGA) and NIC (corundum) out there, and the requirements jump from GigE to 10 GbE is huge.
So if intrinsically they’re around ~10x more expensive, add in the fact that the demand is significantly lower, and 20x makes complete sense.
i think the silver lining here is that extremely high speed usb-c is handy (only) when you need it to be. i can’t get an rp2040 pico board that speaks 5Gbits/s, but i can’t hardly imagine it processing that much data anyways. but if i were to go shopping for SATA HDD enclosures, where that speed might actually be useful, i can find a lot of them purporting to use the higher speeds.
it’s similar to why it’s not such a big deal that the endpoints can have a wide variety of features…it’s like M2…if i were to put an M2 device in my PC, it would probably be flash storage, and my motherboard manufacturer knows that so it supports NVME. the M2 device in my laptop is wifi, so my laptop supports pcie x1 over M2. i only have to test the edges of those slots’ capabilities if i wanted to do something whacky like install a tiny wifi board in my PC or sacrifice wifi for expanded storage in my laptop.
my point is, the lack of features you don’t want isn’t particularly concerning…generally vendors do a good job of filling in the features you do want, in usb-c and everywhere. it doesn’t matter so much if each product (or spec) perfectly anticipates all possible uses, so long as in practice the real needs are fulfilled.
It’d be wonderful if USB3-to-USB2 hubs existed.
No, not those. Or those. Probably not those either. Almost all “USB C to USB 2.0 ports” hubs are just USB 2.0 hubs with a USB C connector – the USB spec doesn’t call out transaction translators for 3->2 like they did for HS->FS/LS, so chips like this guy: https://hackaday.com/2022/03/07/a-chip-to-address-the-fundamental-usb-3-0-deficiency are “special” and don’t always work.
Yes, it’s hard to imagine cheap microcontrollers pushing much past 20-30 MB/s. It’s not hard to imagine 5 of them doing so, and given that laptops have moved to “let’s get rid of all of our USB ports” it’s… not fun.
So if you want to say “USB 3 would be great if the designers weren’t idiots,” that’d be what you would point to.
Well that’s useful to know, I didn’t realise the dual row USB 3 ports were actually 2 ports a in one, that potentially solves a bunch of space issues I have with a Raspberry Pi 3 that needs more ports.
The problem with the variations on USB 3 isn’t that there’s too many names for the same thing, it’s that there’s too many things under the same name and connector.
I have a laptop, a cellphone, and two pairs of wireless headphones that all charge off of a USB-C connector. Obviously I can’t run laptop off the cellphone charger because it’s not powerful enough, but why can’t I charge my cellphone off of the laptop charger? (Really, the cellphone charger should still be able to charge the laptop while its sleeping, because it delivers 20 Watts, enough to charge the battery in hours, not days.)
On top of that, one pair of my headphones also charges off of the cellphone charger and not the laptop charger, but the other pair will charge off the laptop charger but not the cellphone charger!
The problem isn’t limited to power delivery; I also have a slew USB-C to USB-C cables that aren’t cross compatible for data connections, with no clear way to know which will work when. Last I checked, not counting power delivery or active cables, there were six different kinds of USB-C to USB-C cables.
USB-C has 24 pins so I suspect there will be a lot of different variants
To be clear, here’s only six diffpairs you can meaningfully use – the USB2 one, the SBU pair, and four high-speed pairs, and you can squeeze out one more with a custom cable if you’re witty; “24 pins” isn’t quite accurate.
it sounds like you’re living the disaster that is still only hypothetical in my mind.
i’m surprised your pile doesn’t just degrade to trickle charging. i have a whole mess of proprietary micro usb fast chargers but i can mix and match them at will so long as i don’t mind that it takes like 6 hours to charge my phone.
I’ve encountered this too, and it’s part a relic of the early days of USB-C PD, and manufacturers not being as compliant as they could be.
One of my USB-C laptop power supplies will only negotiate 20v power, despite the fact it could likely deliver 5v, 9v, 12v and 15v. Why? Probably because people still think of ‘phone charger’ and ‘laptop charger’ as distinct devices, and there is no business motivation to offer a product that can do both if you can instead sell two products.
There were also a slew of proprietary ‘fast charging’ technologies competing before USB-C PD was firmly established that slowed broader compatibility.
Now that USB-C PD is established and growing, it is possible to live the dream we were promised. I recently purchased a desktop 100w USB-C PD supply that fast charge my phone at 9-15v, laptop at 15-20v, and dozens of other devices with the same USB-C PD cable.
I have had to toss a number non-compliant ‘USB-C’ power supplies and cables along the way, but that’s quite often the case with emerging technology.
Quick note – if you’re not talking about a “20V constantly supplied” USB-C firestarter PSU, it’s nigh certain your PSU can deliver 5V – that’s basically a requirement for it to even function with proper USB-C ports, and devices will go up in flames if it doesn’t. Mind you, 5V operation is just “as soon as a 5.1k pulldown has been detected on the other end”. So, either it can actually do 5V, or you have an actively dangerous PSU.
You can’t? I do that routinely – that’s like, one of the major cool parts of USB-C. I also charge my laptop off my phone charger sometimes, 20-30W isn’t as fast of a charge but it’s generally good enough. Not all laptops support this, but many do. Some headphones and other devices require BS, but 1) it’s rare, and 2) not really a failing of USB-C itself, just a mfg implementing things in a boneheaded way.
not all of them do but this is actually an existing feature with USB-C. My Framework can sure charge that way.
To be clear, if your USB-C cable can’t do any data, it’s probably broken; USB2 (and 60W aka 3A) is the minimum all cables are obligated to do. Not all cables support USB3/DisplayPort/Thunderbolt, those cables require extra pairs and are more expensive – see if your OS complains about an unsuitable cable. My advice – if your cable isn’t labelled with the extra things it supports compared to USB2/60W, label it, helps fix majority of the cable distinguishing issues possible.
Sounds like you’re doing something wrong or lucked out and got completely incompatible equipment somehow.
I’ve never had an issue (that’s a lie) with USB-C. Sure it can be a bit of a gamble knowing what current a random cable supports but some devices will report cable capabilities. My Macbook (that has a 140W charger) can trickle charge from a 15W supply. it does what it can with the 15W without complaining. I can charge phones from the Macbook as well as from the Macbook charger.
The only issue I had with USB-C is when occasionally the Macbook decides to charge itself from the phone, and the phone willingly acts as a charger. You can’t really say that’s a bug though as both can act as a source and a sink so who decides what should do what?
afaict the “who’s charging who” is a bug, and really, it’s a user experience flaw. IMO the user always ought to have choice in this matter – many an OS provides such a choice, too. ig we need more OS makers to catch up with the times and add the necessary APIs&dialogs!
NOOOO that microUSB3 port and connector is plain unsuitable to use, the most fragile useless port I’ve ever experienced. So get a decent USB-A or B USB3 connector over that one every day! As even if you never ever move or cycle that MicroUSB3 cable or port (as in its hot glued together inside a project) it will still break on you. So actually using it for a normal day to day USB hub…..
Much as I hate USB-C I’d still take USB-C over the micro USB3 port if I get any choice… The USB-C spec is perhaps the worst ever made on the KISS principle, or even just basic expectation of electrical function, but at least it is mechanically about as good as any similar connector that small.
Disagree. It’s a pretty simple equation – the hubs with your preferred connectors are obscure, and therefore more likely to be wonky. Also, definitely not my experience with microUSB3 – it can absolutely last. The trick I found, is buying a whole bunch USB-C to microUSB3 cables from Aliexpress – I put a good few of them through severe abuse (seriously, a lot of abuse) and it was a while before they broke. Oh, and external HDDs used to come with decent microUSB3 cables, can recommend those too.
I had a Micro USB 3.0 connector break away from an SDR. Lucky there was no damage and I could repair it easily. Screw those things! I’ll take normal, large, or mini over USB Micro.
Glad to see they’ve switched to using the larger Standard-B connector in the newer revision of the device.
that’s basically the microUSB failure mode =D solder it back, epoxy over the connector shell, and keep using it. USB-B-3 has its own problems – for a start, it’s very bulky, so it’s going to drag your device around the cable, which is also a failure mode given the stress it puts on the device attached and the possible fault conditions (“board fell off the desk”/”levered into a piece of metal and short-circuited”/”antennas broke off”)it introduces. Really, a USB-C port is the solution here – for USB3 purposes, you only need a single mux chip with integrated CC handling, plenty of those around by now.