Setting charging port modes on USBHub3+

2024 March 15


The USBHub3+ can set each of its downstream ports to several power modes to support a range of devices.

The supported modes are part of BC1.2 USB charging specification:

Port mode Mode description Condition Maximum current
(device limited)
SDP: Standard Downstream Port Data and < 500 mA No host or no USB2 data lines connected 100 mA
Host present and USB2 data lines enabled 500 mA
CDP: Charging Downstream Port Data and up to 1500 mA Host present and USB2 data lines enabled 1500 mA
DCP: Device Charging Port Power only up to 5000 mA No Host and USB2 data lines enabled 5000 mA

How do devices detect the type of port they are connected to?

On VBus rising edge:

1) The device sends a pulse on D+, looks for reply pulse on D-

  • No reply: SDP
  • Reply: CDP/DCP

2) The device sends a pulse on D-, looks for reply pulse on D+

  • No reply: CDP
  • Reply: DCP

A walkthrough of port modes using HubTool

If you haven't already, install HubTool, which is part of the Brainstem Dev Kit.
Power on the hub and connect one of the host ports to your computer

All of the VBus LEDs on the front panel should be on. Launch HubTool (located in "bin")

You should see a mostly blank window with the serial number of the connected hub(s) in the lower right.  Click on the hub to connect.
There will be an overview of the hub connections.  

Default behavior: CDP

By default, the downstream ports default to CDP mode if host present, DCP if host absent.  Connecting an iPad (6th generation) to port 0, we see that we are in CDP mode, nominally 5V, 1500mA (device limited)


Port mode is only detected by the device when plugging in or toggling on port power

Switch to SDP mode by disconnecting data lines (100mA max)

Turning off USB2 data lines (uncheck "HS" checkbox) yields no change in current, but we've lost our device information since the data connection was only on the USB2 lines.

Unplug and replug, or toggle power to allow the device to detect port mode. The device recognizes that it is connected to an SDP port with no data lines, and current drops to 70 mA

Turning USB2 back on (re-check "HS" checkbox), current rises to nominally 500mA, since were are still connected in SDP mode, but now with data lines connected

Unplug/replug or toggle Vbus for the port ("power" checkbox) and the device will recognize that it is connected to a CDP and current will return to 1500mA

Switch to SDP mode with data lines and host connected

Uncheck "CDP Mode", click "Save Port States", and then  "Reset".  Let the Hub reset and click on the hub serial number to reconnect.

Port 0 should show the CDP box unchecked, and about 500mA

Switching to DCP mode

To put the port in DCP mode, we need to disconnect the host.  

First, we'll re-enable CDP/DCP. Re-check "CDP", click "Save Port States"  and "Reset" to reset the hub.  reconnect to the hub by clicking on its serial number in the lower right.

Next, let's connect to the hub using our computer to the "Control" port on the back panel using a Mini USB cable and disconnect the host cable. "Upstream" should read "none" showing no host connected.

We are now in DCP mode, which allows a device to draw up to 5A.  The iPad (6th generation)  limits itself to 1A on DCP ports, while an iPad Pro 2018 with USB A-to-C cable draws 1.5A.  



Setting port modes programmatically

You can also set the port modes programmatically using the Brainstem API.  

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.