This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TPS65981: Preference for UFP

Part Number: TPS65981

I have a device that's an accessory for a phone. It is only capable of acting as UFP for data, but it can be a power source when its external charger is plugged in. So my control configuration has these bits set:

- Process Swap to Source

- Process Swap to UFP

- Initiate Swap to UFP

If I set my system configuration to "Presents R_d on CC, supports data/power role swap", then it works as I want it to when the phone is powered. The data port connects as UFP, and when the charger is plugged in, the Barrel Jack Detect Event is triggered and the device becomes the power source for the phone.

With this configuration, when the phone power is off, it does not charge when the charger is plugged in. I understand that to do that, I would need to toggle the R_p/R_d so the phone can detect the connection and start charging. When I set the system configuration to "Toggles R_p/R_d on CC (no try.Src), supports data/power role swap", then the phone will start charging when its power is off. Unfortunately, with this configuration the phone seems to always connect as a UFP, so I can't communicate with it.

My application is like a dock with an optional power supply. I always want to be the UFP, and I want to be the power source whenever the charger is plugged in. How should I configure the PD controller to achieve this?

  • Hi Anthony,

    I would recommend choosing the option "Toggles R_p/R_d on CC (with try.Src), supports data/power role swap" and you can also check in your Control Configuration (0x29) register that the option for "Never Sink if Externally Powered" is checked. In addition, if you do need your PD controller to sink power such as when the power source isn't plugged in, then you will also need the "Process Swap to Sink" option checked.

    Thank you,

    Hari

  • I tried those changes, and it did allow for charging when the connected device was not powered on. However, it caused issues when the connected device was powered on. My device always defaulted to being the power source/DFP. The power and data roles appeared to be coupled. I could send the "Swap to Sink" command to the TPS65981, and the device became the power sink and also the UFP. When I sent the "Swap to Source" command to charge the host, the data role would swap as well and I lost my connection. I tried the "Swap to UFP" command and it didn't work.

    I have PD controller firmware created using the 4.03 version of the TPS6598x configuration program that mostly works the way I want it to, with the exception of not charging when the host is not powered. I tried upgrading the firmware with the 5.13 version of the configuration utility, but the same configuration behaves differently. If I am connected as UFP/Sink and I plug in the charger (BARREL JACK DETECT is triggered), then the power role swaps to source, but the data role also swaps and I lose my connection. Then I'm in the situation described above where "Swap to Sink" changes to UFP/Sink and "Swap to source" changes to DFP/Source. I would expect that "Swap to Source" would just change the power role, leaving me as UFP/Source, which is what I want to happen.

    I'm wondering if another solution might be to change the TPS65981 configuration on the fly, either by using a GPIO to load alternate configurations, or via the i2c bus. The main problem I've run into with that idea is when I've changed the configuration to DRP with the connected device powered off, and I've become the power source, so the connected device is charging. I'm having trouble detecting when the connected device gets powered on in this configuration. The only change in status that I see is that there is a hard reset with the reason that it is "required by protocol". I can detect that reset, but I haven't managed to get from that state to UFP/Source.

  • Hi Anthony,

    Yes, I see what you are trying to do. In this type of a scenario, you can keep it on one configuration file but you may need to make one small change. I would recommend double checking your Port Control, (0x29), Register again and making sure that the fields "Initiate Swap to DFP" and "Process Swap to DFP" are both left unchecked. This type of configuration will allow your device to always remain as a UFP which is what you are looking to do.

    Thank you,

    Hari