Electronic – How to determine the orientation of both ends of a USB-C cable from the UFP device

usbusb-c

As the heading states, I would like to semi-passively detect the orientation of both ends of a USB-C connection. I understand that it is possible for the UFP and DFP devices to infer their own plug orientations, but how would the UFP device itself infer the overall cable arrangement?

I'd like to avoid having to introduce or use a high level protocol (ie USB 2.0 or something else). Low level manipulation of the CC pins or some other method would be acceptable.

Best Answer

The CC pins are used for this but you can only know the state of the connector nearest to the device you have, not the total orientation of the cable.

enter image description here

Only one CC pin is connected through the cable to establish signal orientation and the other CC pin is repurposed as VCONN for powering electronics in the USB Type-C plug.

To establish the proper routing of the active USB data bus from host to device, the standard USB Type-C cable is wired such that a single CC wire is position aligned with the first USB SuperSpeed signal pairs (SSTXp1/SSTXn1 and SSRXp1/SSRXn1) – in this way, the CC wire and USB SuperSpeed data bus wires that are used for signaling within the cable track with regard to the orientation and twist of the cable.

Source: https://www.silabs.com/community/mcu/8-bit/knowledge-base.entry.html/2016/09/26/what_s_the_role_ofc-kQYe

enter image description here

You won't be able to determine both sides of the configuration with passive methods, without some communication between the DFP and UFP, because the USB C connection is made to be symmetrical The devices can determine if they are flipped or not with the CC pins. But because of the symmetry the UFP can only determine if the cable on the UFP end is flipped or not. Likewise the DFP can only determine if the DFP is flipped or not.

Here are the ocnfi

With a controller however, the DFP can be determined from the UFP, but you'll have to get the configuration from the controller through the USB interface.

enter image description here
Source: https://www.richtek.com/assets/product_file/RT1730/DS1730-01.pdf