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.
- [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):
- 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
USB_CCis 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.
- However, in state (C),
USB_CCsits at ~2 V, which makes it hard to differentiate from (A) (~1.6 V), and I'm not sure what determines (C)
USB_CCvoltage 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: