I need to develop a device which has a USB-C port. This port has two purposes:
- One can connect a USB charger to charge the battery of the device
- One can connect USB headphones to listen to some music which is transmitted by the device
I have a bit of trouble understanding how to monitor the CCx lines on the USB-C port. As far as I understand:
- In Audio Adapter Accessory Mode, the CC1 and CC2 lines are connected to GND. That would be when the headset is plugged : CC1 = CC2 = 0 V (link, "Audio Adapter Accessory Mode" section)
- In USB Power Delivery mode, the CC1 and CC2 lines are pulled up by the charger, and down by the device. According to this link, the Table 3. states that CC1 and CC2 lines need to be pulled down to GND with 5.1 k resistors on the device side. So I integrate these resistors and one of the CC line has a greater voltage than the other : CC1 > CC2 or CC2 > CC1
- When nothing is plugged, the CC1 and CC2 lines are pulled down to GND with the 5.1 k resistors. CC1 = CC2 = some mV
Here are my questions:
- Have I correctly understood the configuration of the CCx lines?
- If so, what circuit could I use to detect the 3 possibilities? Is it possible and safe to compare the difference between 0 V and some mV?
Best Answer
You need to support:
In your understanding, you are forgetting about the downstream facing case, you need to pull up both CC lines to see if an USB C passive audio device is connected. You also need to do the full USB C detection, to prevent powering VBUS if the user connects an active cable to the device.
Since you want a single port to act as both an upstream and a downstream facing device, you need to act as a dual device.
Here is a simplified truth table:
A few notes:
(If you would build a circuit like this from simple parts, it would look like this, the cost of the parts would probably be 10 times the cost of dedicated chip)
Note that your circuit should be designed in such a way that if your battery is discharged, it should present a 5.1k resistor on the CC is, so the circuit can start from a dead battery. This likely requires a depletion mode MOSFET or a noisy relay
Using a chip dedicated to the job makes your job easier, an example of such PD chip is the FUSB307B. When your device sis started in dead battery mode, this chip provides a 3.3V power rail, so you can start your micro controller, which then tells the PD controller chip which PD profile it should accept. After this, the chip enables the VBUS rail, so you can charge your battery. This chip also has detection capabilities for USB C passive audio specification, so could do not need to waste CPU cycles detecting this on your own.