Sunday, December 11, 2016

Bitbanging the Quick Charge 2.0 - Without any ICs!

Qualcomm's Quick Charge 2.0 sounds like a cool technology: USB power supply can output 9V or 12V, if QC2.0 compatible device requests so. I have one power supply with QC 2.0 compatible port, but what I don't have is a QC 2.0 compatible device that could take the advantage of that port.
Initially I started researching the QC 2.0 technology, hoping that I could find an IC with simple interface that could be used to request the power supply to output selected voltage. Then I found out that doing those requests is easier than I thought and it could be done without any "QC 2.0 compatible magic ICs".

Warning!

Information below worked in my case, but I cannot promise it will work in other cases. If it works, the USB-port starts outputting 9V or 12V, which may break devices connected to that port. If it doesn't work, voltages applied to D+ and D- lines may break something in the power supply. I don't recommend doing following things based on information I've shared, but if you are still going to do it, you are doing it at your own risk.

Quick Charge 2.0 Handshake

Handshaking between the power supply and the device is required before the power supply can take requests from the device.
Both the handshake and requests to change the output voltage happen by changing the voltages on D+ and D- lines. Handshaking has two simple steps:
  1. Device applies 0.325V-2V to D+ -line. During this time PSU may keep D+ and D- shorted.
  2. After D+'s voltage has stayed on above range for 1.25s, power supply discharges voltage on D- through a pull-down resistor. Device should allow the voltage on D- -line to drop below 0.325V, for example by keeping D- disconnected.

Requests to change the voltage

After the hanshake has been done, device can request other output voltages by applying following voltages to D+ and D- lines:

D+ voltage D- voltage Output
0.325-2V 0.325-2V 12V
>2V 0.325-2V 9V
0.325-2V GND 5V

If the voltage on  D+ drops below 0.325V, the power supply will consider device as disconnected and go back to default mode of outputting 5V. Handshake is required in order to change the output voltage again.

Demonstration

I made simple test circuit out of 3.3V regulator, few resistors and three jumpers. Two resistors form a voltage divider that outputs 1.1V and first jumper connects that to D-.
Another two resistors form  another similar voltage divider and second jumper connects the output to D+. Third jumper increases the output of the voltage divider that can be connected to D+ to above 2V.
I don't have a way to connect D- to ground, but disconnecting the D+ is another way to go back to 5V output.

Sources of information

The simplest description of using QC2.0 including above table was found in pages 6 and 7 of this Texas Instruments' PDF:
http://www.ti.com/lit/ug/tidu917/tidu917.pdf
That PDF references this datasheet, which contains same information in more technical form:
http://www.mouser.com/ds/2/328/chiphy_family_datasheet-269468.pdf