Author Topic: How important are the two 5.1k resistors on USB-C?  (Read 3950 times)

Claude and 2 Guests are viewing this topic.

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4626
  • Country: gb
  • Doing electronics since the 1960s...
How important are the two 5.1k resistors on USB-C?
« on: April 07, 2025, 06:08:19 pm »


I've just done a prototype for something and left a track off which connected the "GND" junction of the two resistors to GND, so there was just 10.2k across A5-B5.

But it all works fine.

Due to the way the connector is reversible, there are actually no resistors visible at all.

Can anyone explain it? I've googled and find only fairly meaningless explanations.

My device is a client and draws about 200mA. It has no OTG capability. The client device is a STM 32F417 USB FS. The Host device is various types of USB hub, some USB2 and some USB3.
« Last Edit: April 07, 2025, 07:45:23 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12014
  • Country: us
    • Personal site
Re: How important are the two 5.1k resistors on USB-C?
« Reply #1 on: April 07, 2025, 07:59:24 pm »
They are important if you use C-to-C cable, since this is how orientation is determined.

If you use C-to-A cable, you won't see a difference, since CCx signals are not even going to make to the A side.

And they are also important if you use e-marked cables.

But if you only use USB2 signals, then behavior depends on the specific host. Some may not care, others may care and not work.
« Last Edit: April 07, 2025, 08:02:47 pm by ataradov »
Alex
 
The following users thanked this post: peter-h

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4626
  • Country: gb
  • Doing electronics since the 1960s...
Re: How important are the two 5.1k resistors on USB-C?
« Reply #2 on: April 07, 2025, 08:07:25 pm »
Quote
If you use C-to-A cable, you won't see a difference, since CCx signals are not even going to make to the A side.

Yes that's a great point. That's all I am using right now. So my client must not draw > 500mA (or 100mA from an unpowered hub or many laptops).

I ought to test it with a C-C cable and a C-output USB charger.

Are there any laptops with a USB-C port? Never seen one.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2923
  • Country: ca
Re: How important are the two 5.1k resistors on USB-C?
« Reply #3 on: April 07, 2025, 08:16:28 pm »
I ought to test it with a C-C cable and a C-output USB charger.
Also make sure you try e-marked cable as they have some peculiarities.

Are there any laptops with a USB-C port? Never seen one.
Seriously? Now it's getting harder to find laptop with ports other than USB-C.
« Last Edit: April 07, 2025, 09:06:20 pm by asmi »
 
The following users thanked this post: peter-h

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4626
  • Country: gb
  • Doing electronics since the 1960s...
Re: How important are the two 5.1k resistors on USB-C?
« Reply #4 on: April 07, 2025, 08:45:51 pm »
I found nothing "e-market". It is "e-marker" :)
https://www.amazon.co.uk/Cablecc-10Gbps-Marker-Tablet-Laptop/dp/B07VZ4V115

and a USB-C power supply
https://www.amazon.co.uk/gp/product/B0CXPFZBF8

Last laptop I bought was an XPS13 :) Win10.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline chrono68

  • Contributor
  • Posts: 15
  • Country: us
  • Electronics Technician
Re: How important are the two 5.1k resistors on USB-C?
« Reply #5 on: April 07, 2025, 09:40:50 pm »
Quote
If you use C-to-A cable, you won't see a difference, since CCx signals are not even going to make to the A side.

Yes that's a great point. That's all I am using right now. So my client must not draw > 500mA (or 100mA from an unpowered hub or many laptops).

I ought to test it with a C-C cable and a C-output USB charger.

Are there any laptops with a USB-C port? Never seen one.

Hell not only do laptops come with mostly USB-C ports, but most laptops come with a USB-C charger.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16359
  • Country: fr
Re: How important are the two 5.1k resistors on USB-C?
« Reply #6 on: April 07, 2025, 10:39:49 pm »
With a real USB-C host, this is not just for orientation (which usually doesn't matter if you strictly use the D+/D- pairs, which are themselves supposed to be paralleled on your device in 99.99% of the cases), but primarily to make the host detect your device as a USB device. Otherwise, it won't even care to enumerate it. In theory, you could do with using only one of them on either CC1 or CC2, except that "standard" USB-C to USB-C cables only have one wire for CC (which is precisely made to enable orientation detection, when it matters), so that if you put only one of these resistors in your device on either CCx, it will only work in one orientation as the host won't see the device as a device in the other orientation.

So omit those two resistors, and your device won't work when connected to a real USB-C port. And omit one of them, and cables will work only in one orientation: nice way to irritate your customers! That may not be widely available on typical desktop computers yet, but most laptops do now and some don't even have USB-A ports anymore. So you really don't want to play with that. It won't feel nice.
« Last Edit: April 07, 2025, 10:42:47 pm by SiliconWizard »
 
The following users thanked this post: samofab

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 4101
  • Country: us
Re: How important are the two 5.1k resistors on USB-C?
« Reply #7 on: April 07, 2025, 11:57:15 pm »
I found nothing "e-market". It is "e-marker" :)
https://www.amazon.co.uk/Cablecc-10Gbps-Marker-Tablet-Laptop/dp/B07VZ4V115

Any super-speed cable or cable that can carry alternate modes (displayport/thunderbolt) are e-marked.  As are any cables that can carry > 3 amps.  Unmarked cables are always USB 2.0 speed only, 3 amps max.

A USB type-C host or power supply will not even turn on VBus until it detects Rd.  So if your device is bus powered, it will not even power up when used with common charger.
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4626
  • Country: gb
  • Doing electronics since the 1960s...
Re: How important are the two 5.1k resistors on USB-C?
« Reply #8 on: April 08, 2025, 06:25:03 am »
I've ordered that USB-C power supply. Maybe I should borrow a new laptop also :)

The current product is micro-USB and is all fine, but I've modded the PCB with USB-C so testing it now.

How much current is guaranteed to be available via USB-C if using just the 5.1k? I know USB2 is 500mA (unless unpowered hub; then it is 100mA). USB3 PC/laptop connectors are 900mA but you are supposed to negotiate (TPS2511 etc).
« Last Edit: April 08, 2025, 11:11:51 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12014
  • Country: us
    • Personal site
Re: How important are the two 5.1k resistors on USB-C?
« Reply #9 on: April 08, 2025, 01:47:46 pm »
USB3 devices default to 900 mA maximum. And you can't passively request more. On the device side resistors always remain 5.1 kOhm. Those resistors form a divider with pull-up resistors in the host and depending on the voltage after the division host will advertise capability to deliver 1.5 A or 3 A. If host advertises higher current and you sensed it, then you can consume that much.

Before enumeration the same 100 mA limit applies and that 900 mA limit only applies to devices that actually enumerated as USB3 via USB3 pins. Not just devices using USB3 connectors, but enumerating over USB2 pins (like in this case). The power indication is in the descriptors and descriptors have different meaning when communicated over USB2 vs USB3.
« Last Edit: April 08, 2025, 01:49:43 pm by ataradov »
Alex
 
The following users thanked this post: pardo-bsso, peter-h, pastaclub

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16359
  • Country: fr
Re: How important are the two 5.1k resistors on USB-C?
« Reply #10 on: April 08, 2025, 04:12:48 pm »
Yes. One "simple" way of determining if you can draw more than 500 mA in this case is sensing CC1/CC2 voltages on the device side. Note that even if you do this, it means that once enumerated, you *can't* draw more than 500 mA until you have determined that the host can deliver more (by sensing CC1/CC2). So your circuit must handle this and not draw the max current right from power-on. It can't even draw more than 100 mA *before enumerating* either, as ataradov mentioned, something that some USB devices fail to respect (and while that may "work on your own machine", that will make some computers, especially laptops, pretty unhappy).

All that means that your device must have power switches and/or current limiting as appropriate and control these from your microcontroller.

Sensing CC1/CC2 will just require 2 ADC inputs, and the standard voltages should not exceed about 2V IIRC - but you may still want to add some protection between that and the ADC inputs to avoid frying the MCU just in case.
 
The following users thanked this post: pastaclub

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12014
  • Country: us
    • Personal site
Re: How important are the two 5.1k resistors on USB-C?
« Reply #11 on: April 08, 2025, 04:51:16 pm »
You technically don't need to sense them at all in either case. Before enumeration you consume less than 100 mA, then in the first step of enumeration you tell the host how much you want to consume in the descriptor. This is where USB2 tops out at 500 mA. USB3 uses units of 150 mA, so you can request a lot more. The host then may decline the enumeration if requested current is higher than host capability.

Whether any hosts actually look at the requested power - no idea.
Alex
 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4626
  • Country: gb
  • Doing electronics since the 1960s...
Re: How important are the two 5.1k resistors on USB-C?
« Reply #12 on: April 08, 2025, 07:53:37 pm »
Years ago I looked at the USB2 laptop sort of current limiting and there didn't seem to be any at 100mA. I've been selling USB powered products for about 20 years, which have the MOSFET power switching, 90mA current declaration, FTDI chips with on-chip and separate EEPROMs, all done properly, etc. But there is no evidence it is needed. What certainly does exist (USB2) on laptops is a cutoff (a trip) > 500mA.

This product, USB-C, draws 350mA max. But it does have a few uF of caps on the 3.3V rail, which is derived from VBUS with a R1191H033B regulator. I chose that reg because you can OR the outputs of multiple ones, with no current going back into any of them.

Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline bson

  • Supporter
  • ****
  • Posts: 2575
  • Country: us
Re: How important are the two 5.1k resistors on USB-C?
« Reply #13 on: April 08, 2025, 08:18:22 pm »
Whether any hosts actually look at the requested power - no idea.
Realistically you can draw the full "passive" 900mA from the moment you're plugged in.  Otherwise if there's nothing to enumerate and you're only using it as a power socket you could never get past 100mA without putting some token device on the bus.  And the vast majority of USB-C power supplies I'm sure will never enumerate, either.  Are you sure this pre-enumeration limit wasn't a USB-2 thing that was retired in USB-3?  Because it makes no sense.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16359
  • Country: fr
Re: How important are the two 5.1k resistors on USB-C?
« Reply #14 on: April 08, 2025, 09:35:43 pm »
You technically don't need to sense them at all in either case.

You do if you want to be able to draw more than 500 mA from a USB-C host (when it allows) while using only USB FS or HS, which is a pretty common use case these days. If you stick to max 500 mA, of course you don't need to.
But by sensing CC1/CC2 and in 99% of cases connecting to a USB-C port, you'll be able to draw up to 1.5A or even 3A, without the need to negotiate it. But unless you sense CC1/CC2, you won't know if you can. If you want more than this or over 5V for VBUS, then you'll need a USB-PD controller.
 
The following users thanked this post: pastaclub

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12014
  • Country: us
    • Personal site
Re: How important are the two 5.1k resistors on USB-C?
« Reply #15 on: April 08, 2025, 10:15:30 pm »
you could never get past 100mA without putting some token device on the bus.
For USB2 there are 3 possible port types that devices technically need to detect:
1. Standard downstream port (SDP). Detected by standard host pull-up resistors on D+/D-. If you detect this port, you can't draw more than 100 mA before enumeration.
2. Charging downstream port (CDP). This can deliver up to 1.5 A even before enumeration, the detection procedure still applies, but it is not a full enumeration, just some combination of setting and reading back the levels.
3. Dedicated charging port (DCP). This is a basic power supply with no data connection. It is indicated by shorting D+/D- on the source side and need to be detected by the device. You are supposed to drive 0.6 V into one pin and read it back from the other.

The last two are part of the separate battery charging specification and not the main USB spec.

In practice the only time I've seen any of this implemented on the device side is with dedicated battery chagrining ICs, which do those negotiations. Standard bus powered devices just consume whatever and hope it works.

Are you sure this pre-enumeration limit wasn't a USB-2 thing that was retired in USB-3?  Because it makes no sense.
No idea what happened in USB3. Given that all high-current ports were not part of the main spec, all that could have been simplified.
« Last Edit: April 08, 2025, 10:19:25 pm by ataradov »
Alex
 
The following users thanked this post: splin, pastaclub

Offline gabiz_ro

  • Regular Contributor
  • *
  • Posts: 129
  • Country: ro
Re: How important are the two 5.1k resistors on USB-C?
« Reply #16 on: April 09, 2025, 06:53:13 am »
On USB-C host side or charger until something is connected and properly detected on CC pins for powering device, nothing works.
Most simple is with 5.1K resistor that will enable charger or host to provide 5V power to connected device

 

Online peter-hTopic starter

  • Super Contributor
  • ***
  • Posts: 4626
  • Country: gb
  • Doing electronics since the 1960s...
Re: How important are the two 5.1k resistors on USB-C?
« Reply #17 on: April 09, 2025, 07:27:06 am »
I wonder how many USB-C chargers implement that? Let's face it - if they just put a 5V regulator (3A or whatever) onto the power pins, most users would not notice :)

I bought a genuine (to the extent that something on Amazon is genuine) Samsung USB-C charger for this test. Hopefully it implements it right. Junk chargers will probably just do what I describe above. Just like chinese POE injectors which just put 48V across the little resistors in your non-POE RJ45 ;)
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 
The following users thanked this post: bson

Offline 5U4GB

  • Frequent Contributor
  • **
  • Posts: 790
  • Country: au
Re: How important are the two 5.1k resistors on USB-C?
« Reply #18 on: April 09, 2025, 11:54:11 am »
They are important if you use C-to-C cable, since this is how orientation is determined.

If you use C-to-A cable, you won't see a difference, since CCx signals are not even going to make to the A side.

If you are going to use USB-C for power, please take the time to set it up right.  There are large numbers of incorrectly-configured devices out there with USB-C sockets that were only ever tested with USB-A to C cables that then glitch (typically only glitch, never fail obviously and fully) with a USB C to C cable.  This can lead to days or even weeks of debugging (depending on how intermittent it is) trying to track down the problem.

We really need a non-multi-thousand-dollar device that you can plug in upstream that'll tell you whether your USB-C device is configured correctly, in the same way that now-ubiquitous USB-C cable testers dealt with the slew of garbage USB-C cables in the past.
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 4101
  • Country: us
Re: How important are the two 5.1k resistors on USB-C?
« Reply #19 on: April 09, 2025, 01:37:13 pm »
I wonder how many USB-C chargers implement that? Let's face it - if they just put a 5V regulator (3A or whatever) onto the power pins, most users would not notice :)

I'm sure there is non compliant junk out there but I would expect any reputable brand to do this correctly.  Higher end chargers that support more than 15 watt charging are going to implement PD.  Those  are almost certainly going to work this way.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16359
  • Country: fr
Re: How important are the two 5.1k resistors on USB-C?
« Reply #20 on: April 09, 2025, 01:51:57 pm »
I wonder how many USB-C chargers implement that? Let's face it - if they just put a 5V regulator (3A or whatever) onto the power pins, most users would not notice :)

Yes they would. Just connect two such "chargers" with a USB-C to USB-C cable and enjoy the fireworks. That would be completely unacceptable. That's something that wasn't an issue with older chargers with USB-A connectors, unless the user *made* or found a cable that isn't commonly available, that is USB-A to USB-A. Something manufacturers could reasonably not expect.

Yes, USB-C is complicated and can quickly become a rabbit hole. Switching to it has consequences and is not painless.
 

Offline bson

  • Supporter
  • ****
  • Posts: 2575
  • Country: us
Re: How important are the two 5.1k resistors on USB-C?
« Reply #21 on: April 10, 2025, 12:07:02 am »
Just like chinese POE injectors which just put 48V across the little resistors in your non-POE RJ45 ;)
Ahhhh!  So THIS is why my biasing resistors keep going up in smoke...  |O
I thought it was me, but no... it's you, cheap Chinese PoE switch!!!  Well, that's one mystery less in my life... :)
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 9769
  • Country: fi
Re: How important are the two 5.1k resistors on USB-C?
« Reply #22 on: April 10, 2025, 05:24:52 am »
Yes they would. Just connect two such "chargers" with a USB-C to USB-C cable and enjoy the fireworks. That would be completely unacceptable. That's something that wasn't an issue with older chargers with USB-A connectors, unless the user *made* or found a cable that isn't commonly available, that is USB-A to USB-A. Something manufacturers could reasonably not expect.

Yes, USB-C is complicated and can quickly become a rabbit hole. Switching to it has consequences and is not painless.

Maybe most importantly, the era of simplicity is over and people deal with it. Chinese technology is very different to what it was 15 years ago. China is now full of decent engineers, even software engineers. 15 years ago it was obvious that the lowest-cost Chinese option fails at meeting every requirement and spec. Not so much anymore, with huge economy of scales and good availability of well educated engineers they can meet the same price goal while doing things correctly and within spec.

Chinese simply can design a complicated USB-C power management / communication IC from scratch, fabricate it, design chargers, devices and cables around it, following the specs, and still sell the product for $2 at Aliexpress.

Cheap non-compliant crap of course still exists, but it's not an obvious default anymore.
 

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2923
  • Country: ca
Re: How important are the two 5.1k resistors on USB-C?
« Reply #23 on: April 11, 2025, 01:36:20 pm »
Chinese simply can design a complicated USB-C power management / communication IC from scratch, fabricate it, design chargers, devices and cables around it, following the specs, and still sell the product for $2 at Aliexpress.
They don't even need to do that, as most vendors in the power space has already designed such ICs a while ago and now offering them for peanuts (in volume).

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 9769
  • Country: fi
Re: How important are the two 5.1k resistors on USB-C?
« Reply #24 on: April 11, 2025, 02:36:39 pm »
They don't even need to do that, as most vendors in the power space has already designed such ICs a while ago and now offering them for peanuts (in volume).

That is thanks to competition; they know that unless they offer them for peanuts, Chinese will make a fully-Chinese equivalent no problem.

Gone are the days of having to buy some $5 Linear Technology IC to do some trivial thing. High quality, well engineered and well documented, for sure.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf