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.

TPS65987D: Switch between sink and source while external power is still present

Part Number: TPS65987D

Hello,

we have designed a portable and battery powered measurement device. The end user has to attach a tablet via USB to control the measurement. We now want to add a USB C charging functionality (20V/2.5A) to our measurement device, so the user can charge his tablet. It should be possible to switch the charging process off any time, to maximize the operational time of our measurement device. We want to use the TPS65987D as USB PD controller and tried a few things with TPS65987EVM but somehow it is not working as expected.

First we remapped the barrel jack event to a jumper but the jumper position doesn't seem to have a effect at all. The eval board was either always charging or not charging at all, when we set the "only advertise when externally powered" setting in the 20V/2.5A PDO. Then we tried to execute the "swap to sink" command, but it seems that eval board immediately swapped back to source again. Unfortunately we have no protocol analyzer for the USB CC lines and the internal debugger of the eval board works very unreliable.

1. What's the preferred way to disable sourcing in our application? It is ok to use the barrel jack event for this and, if yes, how shall we configure the TPS65987D? It is important that the USB communication does not get interrupted during a swap.

2. To minimize looses I would like to use both internal power switches of the TPS65987D in parallel for sourcing. It is ok to not select any sink switch at all in the configuration?

I appreciate your help,

best regards

  • Hi Tom,

    There's a lot of info here, so let me try my best to help you out. 

    1. What's the preferred way to disable sourcing in our application? It is ok to use the barrel jack event for this and, if yes, how shall we configure the TPS65987D? It is important that the USB communication does not get interrupted during a swap

    • Do you have some type of embedded controller on your system? If so, would it have the ability to read/write to the PD controller? Or are you wanting to update the capabilities of the PD controller purely based on hardware connected to a GPIO?

    2. To minimize looses I would like to use both internal power switches of the TPS65987D in parallel for sourcing. It is ok to not select any sink switch at all in the configuration?

    • If you were implementing a system that only acted as a source and only acted as a sink, I would say this type of architecture is fine. However, since you are wanting to act as both a source and sink, I would recommend having a dedicated source and sink power path.

    As far as a PD analyzer, I would strongly recommend to get one. It allows for you to read the messaging between two PD controllers and help isolate a particular problem. For example, in this instance, you are wanting the EVM to swap to sink but it is not executing properly. If I was debugging this, the first thing I would do is check the PD log to see if the EVM was sending a swap to sink command to the connected device. If it is not, then the issue is related to the PD controlle or how the message is being sent to us. If we are sending the command, but the connected device is rejecting it, then the EVM is doing what it is supposed to and the connected device is the reason why the power role swap did not occur. This is one specific example, but you will find others as you evaluate your own system where a PD analyzer will be invaluable. 

    I usually point people to the Total Phase PD Analyzer. It is the most bang for your buck in my opinion. 

    https://www.totalphase.com/products/usb-power-delivery-analyzer/ 

  • Hello Adam,

    thanks for your fast reply:

    Do you have some type of embedded controller on your system? If so, would it have the ability to read/write to the PD controller? Or are you wanting to update the capabilities of the PD controller purely based on hardware connected to a GPIO?

    We already have a MSP430 in our system. We want him to control the PD controller too. It doesn't matter if either via I2C or GPIOs, we have enough spare ressources.

    If you were implementing a system that only acted as a source and only acted as a sink, I would say this type of architecture is fine. However, since you are wanting to act as both a source and sink, I would recommend having a dedicated source and sink power path.

    I am not sure whether I described our plan correct. We only want to source current into the tablet from our measurement device, not vice versa. I guess we need to perform a swap to the sink role to disable charging (?) but wont draw any current from VBUS. The sequence would be: MSP430 receives the trigger to disable charging -> *magic* -> TPS65987D resets his PDO GPIO, so our external voltage regulator goes from 20V to 5V -> TPS65987D opens both of his internal source switches while becoming the sink and closing no sink switch. Is this more or less correct/possible?

    I'll check the PD analyzer. Our hope was that it work's out of the box :)

    Best regards

  • Hello,

    If you have a controller available, then I would suggest going the route of using the SWSk and SWSr 4cc commands as described in the host interface technical reference manual. You would do this type of implementation if you want to become a sink.

    However, since you never want to draw power while acting as the sink, you could also just change the advertised source capabilities. You will need to create two different configurations using the application configuration tool, and you would load each configuration based on the toggling of a GPIO. You can follow the USB-C-PD-DUO-EVM and the source side to see how to implement this type of implementation.

    How I see it, these are the two options available to you. Let me know which one you decide, and happy to help answer any further questions you may have

  • Hello Adam

    your proposal with the two configurations sounds good. We will try it and I will reply to you here, but most likely not before next week.

    Best regards

  • Hello Adam,

    I tried your proposal with the two different configuration sets today. After a little bit trial and error it seems to work.

    Thanks a lot and best regards