User Tools

Site Tools


projects:usb-c-ify

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
projects:usb-c-ify [2025/11/19 15:08] – [#TODO: USB-PD + PPS and QC] adminprojects:usb-c-ify [2025/11/19 22:51] (current) – [USB-C device roles] admin
Line 3: Line 3:
 ====== USB-C-ifying ====== ====== USB-C-ifying ======
  
-Having several different chargers for devices is tedious. Read about how to convert nearly everything into USB-C. \\+Having several different cables and chargers for devices is tedious. Read about how to convert nearly everything into USB-C. \\
  
 It can be done two ways: \\ It can be done two ways: \\
Line 84: Line 84:
  
 ==== TODO ==== ==== TODO ====
 +https://pcbartists.com/design/embedded/how-to-replace-microusb-with-usb-c-connector/ \\
 + In connectors that do not expose the CC1 and CC2 pins, they are simply connected internally to make things easy for you.
 +
 USB-PD (65W) fast charger buck boards \\ USB-PD (65W) fast charger buck boards \\
 Bidirectional power bank modules: e.g. IP2369, read [[:projects:drill-powerbank-pd|DIY drill power bank]] \\ Bidirectional power bank modules: e.g. IP2369, read [[:projects:drill-powerbank-pd|DIY drill power bank]] \\
Line 127: Line 130:
 "Just" request the desired nominal battery voltage via USB-PD PPS or QC3, which is then connected to the BMS. \\ "Just" request the desired nominal battery voltage via USB-PD PPS or QC3, which is then connected to the BMS. \\
  
 +
 +===== voltage regulators =====
 +
 +Using a voltage regulator is the classical, passive way. Either use a switching regulator or an LDO. \\
 +Advantage: No special USB power supply needed. No software required. \\
 +Disadvantage: Bulky or LDO heating up. \\
  
 ==== switching regulators ==== ==== switching regulators ====
Line 175: Line 184:
 - [[custom PCB for Sony Ericsson FastPort USB-C replacement in C901]] \\ - [[custom PCB for Sony Ericsson FastPort USB-C replacement in C901]] \\
 - install USB-C breakout board in various devices like PSP, PowerBank, etc. \\ - install USB-C breakout board in various devices like PSP, PowerBank, etc. \\
 +
 +
 +
 +====== USB-C cables ======
 +
 +Depending weather a USB-C cable is USB2.0 or USB3.1 the wires inside the cable vary. \\
 +See USB-C pinout: [[https://pinoutguide.com/Slots/usb-type-c_pinout.shtml]] \\
 +Read the [[https://hackaday.com/2016/04/22/hackaday-dictionary-usb-type-c/|hackaday.com USB-C dictionary]] \\
 +
 +Depending on device type there might be direct audio output on USB-C socket, which let's you use a passive adapter - unlike [[https://www.ifixit.com/News/8448/apple-audio-adapter-teardown|Apple lightning active audio adapter]] and [[https://www.zmescience.com/science/news-science/x-rays-usb-c-cables/|Apple's USB-C cable]]. If you want to build your own active USB-C audio cable, read [[https://daumemo.com/diy-micro-usb-c-to-3-5mm-adapter-and-headphone-amplifier-part-4/]]. \\
 +
 +USB-C cables are not necessarily passive. There might be so called e-marker chips connected to the CC-pins. \\
 +
 +
 +^ Cable Type            ^ Max Current ^ Max Wattage ^ How Power Capability Is Determined ^ Inside the Cable ^ Notes ^
 +| Non-e-marked (Standard USB-C Cable) | 3A | up to 60W (20V×3A) | No e-marker detected → Host must assume max 3A | No chip, no special resistors | Only CC pass-through wiring; CC resistors are in the devices, not in the cable |
 +| E-marked Passive Cable | 5A | up to 100W (20V×5A) | E-marker chip reports 5A capability over CC line | E-marker chip on CC1/CC2 | Required for 5A operation; includes cable ID, current rating, voltage rating |
 +| EPR E-marked Cable (Extended Power Range) | 5A | up to 240W (48V×5A) | E-marker reports EPR capability and 50V tolerance | E-marker chip with EPR fields | Needed for USB-PD 3.1 (28V/36V/48V) high-power charging |
 +| Active USB-C Cable (USB4/High-Speed) | Typically 5A | up to 100W or 240W (if EPR) | E-marker reports current + data capability | E-marker + active signal conditioning | Used for USB4/Thunderbolt; power still determined by e-marker |
 +
 +====== USB-C device roles ======
 +
 +Read [[https://www.wandkey.com/usb-c-pinout-guide-and-features/]] for more info. \\
 +
 +USB-C devices have different roles: \\
 +
 +^ Device Role ^ Meaning ^ CC Resistors Used ^ CC Behavior ^ Notes ^
 +| DFP (Downstream Facing Port) – Source | Provides power (charger, host) | Rp (56k, 22k, or 10k) | Pull-up on CC1 and/or CC2 | Advertises current: 56k=Default, 22k=1.5A, 10k=3A |
 +| UFP (Upstream Facing Port) – Sink | Consumes power (phone, device) | Rd (5.1k) | Pull-down on CC1 and CC2 | Signals “I want power”; source detects Rd to begin supplying VBUS |
 +| DRP (Dual Role Power) | Can be source *or* sink | Switches between Rp and Rd | Toggles Rp ↔ Rd periodically | Used in phones, laptops, some MCUs; role decided via toggling rules |
 +| Accessory Mode (Audio/Debug) | Special accessories | Ra (~800Ω) | Pull-down on both CC pins | Triggers analog audio or debug accessory mode |
 +| Cable Plug with E-Marker | Certified 5A or USB4 cable | No resistors; digital IC | Communicates via CC and powered over VCONN | Identifies cable capabilities (5A, EPR, USB4, length, vendor) |
 +
 +
 +USB-C power roles are configured with CC-pin resistor values inside the devices - CC-pins MUST be connected. \\
 +In connectors that do not expose the CC1 and CC2 pins, they are simply connected internally to make things easy for you. \\
 +Selecting Sink or Source via the USB-C CC pins is conceptually equivalent to the micro-USB ID pin (4), which sets the OTG role by making the device act as the Source/Host (DFP) when the ID pin is grounded. \\
 +
 +^ Name ^ Value ^ Used By ^ Meaning ^
 +| Rd (pull-down) | 5.1 kΩ | Sink (device that *consumes* power, e.g., phone) | “I am a sink. Please provide power.” |
 +| Rp (pull-up) – Default | 56 kΩ | Source (charger/host) | “I can supply DEFAULT USB current (500 mA / 900 mA).” |
 +| Rp (pull-up) – 1.5 A | 22 kΩ | Source (charger/host) | “I can supply 1.5 A.” |
 +| Rp (pull-up) – 3.0 A | 10 kΩ | Source (charger/host) | “I can supply 3.0 A.” |
 +| Ra (accessory pull-down) | ~800 Ω | Audio/Debug accessories | “I am an analog accessory (audio, debug, etc.).” |
 +
 +Everything else (voltages, 5A capability, data mode, PD negotiation) is digital, not resistor-coded. \\
 +
 +
 +====== USB data libraries ======
 +
 +For MCUs w/o USB, you might be able to bitbang it. \\
 +
 +[[https://www.obdev.at/products/vusb/index.html]]: VUSB: Bitbang USB on AVR \\
 +[[https://hackaday.com/2012/02/09/learning-to-use-the-v-usb-avr-usb-firmware-library/]]: VUSB on AVR tutorial series \\
 +[[https://github.com/hathach/tinyusb]] \\
 +
 +VUSB projects: \\
 +[[https://github.com/wagiminator/VUSB-AVR]] \\
 +[[https://github.com/jojolebarjos/vusb-gamepad]] \\
projects/usb-c-ify.1763561290.txt.gz · Last modified: by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki