Contents:

Car dock for HTC mobile phones

Research

Linux source code

Measurements

Resistor ranges

Making the cable

The Micro-USB connector

The USB-A connector

Warning

Related: USB Mini connectors: Abuse of pin 4, Benq switching power supply

Car dock for HTC mobile phones

I wanted to power my HTC Desire Z phone from my 5V 3A power supply in my car. As I know, that the original dock can automatically start the car panel, I researched a bit to find how to do it.

Research

I found that it is based on Micro USB pin 4 (ID) voltage.

Pin 4 has a pull-up, and depending on the voltage there, it switches to different modes. I decided to look inside the kernel source code to find more.

Linux source code

Linux kernel source code vision-2.6.35-gb-MR has its driver in drivers/usb/gadget/msm72k_udc.c. It shows following ADC values accepted:

FromToFunction
0x00000x1173desk dock or MHL
0x11740x1E38car dock
0x21120x3D53USB audio
0x59990x76B0MHL

To convert these values to resistance, we need to know the pull-up resistor and way how the voltage is measured.

Measurements

Trying to measure and generalize, I got these design values:

It implies following equation for conversion of resistance to ADC value:

ADC = R1 / (R1 + 100kΩ) × 131072

Value for resistors corresponding particular value:

R1 = 100kΩ / (131072/ADC - 1)

Resistor ranges

Here is a table of required resistor values:

FromToFunction
0.00kΩ3.53kΩdesk dock or MHL
3.53kΩ6.27kΩcar dock
6.91kΩ13.61kΩUSB audio
21.21kΩ30.18kΩMHL

(It does not mean that all mentioned functions are implemented in all models.)

I just experimentally verified the value of the desk/car dog threshold value and it seems to match.

Making the cable

The cable is similar to the standard Micro-USB charging cables, but it has something special inside the Micro-USB case.

The Micro-USB connector

There is one special thing inside the Micro-USB connector case: pin 4.

Warning: Don't short short pin 2 (D−) and pin 3 (D+) as other high current chargers! The phone switches with this cable automatically. And if you do that, false charge happens. Indicator shows charging progress and LED indicates full charge, but the batery is nearly depleted after disconnecting of the cable.

Micro-USB connector view Micro-USB connector detail

The USB-A connector

USB-A side uses standard power line wiring. You can use any connector you need for 5V power in your car.

Warning

Not all HTC devices use the same resistors. For example HTC Desire X requires 10kΩ resistor.