0
\$\begingroup\$

Using the USB-C specification as reference, I cannot figure out how to actually switch Rd and Rp resistors on and off using MOSFETs in a real schematic, without requiring external power/battery, i.e. a bus powered device.

Edit: Apparently this is called "dead battery mode" in USB nomenclature.

How can a schematic support:

  • naturally presenting as a UFP when no external power is available (USB bus powered), so that the device takes power from the bus.
  • the ability to determine USB connection state (i.e. if a USB Device or Host is connected, or not)
  • and the ability to become a DFP depending on the USB connection state, if an external power supply is available.

The USB spec shows simplified "switch" symbols, but what kind of switches do you actually need to use in a real circuit?

Do I just have the wrong approach entirely? Maybe I should always leave the 5.1 kΩ Rd resistor connected to ground and turn on a current source instead of the Rp pull-up when I want to enter DFP mode.

Background Motivation:

  • [For debug data & firmware updates] DFP mode should be enabled if a USB Host is attached at boot-time for debug data & firmware updates. For ease of use, it should not need to require an external power supply.
  • [For standard device operation] UFP mode is entered if no host PC is connected at boot-time & is used for standard device operation. It of course requires an external power supply.

Given these requirements, I came up with this schematic (see below):

  1. The 1 MΩ pull-up is supposed to make the device initially present itself as a UFP, so that it can get power over USB-C
  2. USB_CC is connected to an ADC and monitored to determine if (A) a PC Host is connected on boot, (B) a USB device is connected (C) no device is connected.
  3. However, in state (C), USB_CC sits at ~2 V, which makes it hard to differentiate from (A) (~1.6 V), and I'm not sure what determines (C) USB_CC voltage so it might not always be ~2 V. I think my transistor is not in saturation mode, but I'm not sure how I can make it enter saturation mode. I could use a transistor with a lower Vgs(ths) but given that USB_CC = 5.1k / (5.1k+56k) * 5 = 0.417 V, do I have enough voltage to turn on any transistor? 450 mV seems the lowest threshold you can get a transistor for.

The big question: What kind of schematic do I need to support naturally presenting as a UFP, have a predictable USB_CC voltage for states (A), (B), & (C), and the ability to become a DFP if in state (B) or (C) after boot-time??

The problem is (before 5 V is available) QRD1 never reliably enters saturation regardless of RD2 value:

enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ You could use a miniature DPDT relay to switch the resistors into DFP mode when power is available, though it's a bit wasteful on power. Or configure as UFP and use USB-PD to swap to DFP when you want. \$\endgroup\$
    – Finbarr
    Commented Aug 4, 2022 at 8:47
  • \$\begingroup\$ I'm considering it. Apparently some USB IC's also support a "dead battery mode" that does this too, but I dont want to use an IC. ti.com/lit/an/slvae65/… \$\endgroup\$
    – randyrand
    Commented Aug 4, 2022 at 8:54

2 Answers 2

1
\$\begingroup\$

I've found this reference implementation that is somewhat useful, but it requires external power, which defeats the purpose of defaulting to USB Device mode in order to get power.

https://www.compel.ru/wordpress/wp-content/uploads/2020/04/an5225-usb-typec-power-delivery-using-stm32xx-series-mcus-and-stm32xxx-series-mpus-stmicroelectronics.pdf

enter image description here

\$\endgroup\$
0
\$\begingroup\$

You can also use a BSD840N, which has a pretty low Vgs(thrsh) of 300mV minimum.

https://community.infineon.com/t5/Knowledge-Base-Articles/DEAD-BATTERY-CHARGING-IMPLEMENTATION-IN-CCG1-SOLUTIONS-KBA97273/ta-p/259059

enter image description here

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.