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: Fetching SoC from Power Bank Using TPS65987D IC

Part Number: TPS65987D
Other Parts Discussed in Thread: TPS65987

Tool/software:

I’m working on a project where I need to fetch the State of Charge (SoC) from a power bank using the TPS65987D USB-C Power Delivery (PD) controller IC. Does anyone have experience or guidance on how to retrieve this data? Specifically, I’m looking for insights on configuring the TPS65987D to communicate with the power bank, any necessary firmware settings, or external components required to extract SoC information. Any help or examples would be appreciated!

  • Hi Muhammad,

    In order to get SoC from a far end PD device, you need to send a "Get_Battery_Status" Message, and receive a "Battery_Status" Message in response.

    You can find more information about the specific messaging the the USB-C PD Spec found here: https://www.usb.org/documents  (search battery_status)

    To send a Get_Battery_Status message using the TPS65987, you can use the GBaS "4CC" command. Once sent, and if successful, it will store the message in the Received Battery Status Data Objects register, where you can obtain the data and decode the SoC information. See more information in the device TRM.

    Thanks and Regards,

    Chris

  • Hi Chris,

    Thank you for your detailed guidance on getting the SoC information. I have actually tried implementing this approach already - specifically using the GBaS 4CC command with the TPS65987. While I can confirm that the basic power delivery and negotiation are working correctly, and I'm able to access other registers successfully, I'm running into issues specifically with the specific 4CC commands not working as expected.

    Would you be able to share any additional troubleshooting steps or common pitfalls to check? I want to make sure I'm not missing something in the implementation.

    Best regards,
    Muhammad S.

  • Hi Muhammad,

    Ideally, I would ask that you obtain a PD Log (A log of the cc line communication that decodes the PD messages, requires a specific analyzer) that would allow us to view the messaging and see if a battery status message is being sent out. If you do have this tool, it would be helpful to see the logs.

    A Battery status message may be failing for multiple reasons, let me go through the steps so you can debug on your end.

    1.  Issue with '4CC' command.
      1. If you are not executing the GBas command properly, it will not execute.
      2. Make sure you are executing the 4CC command properly, I would recommend first trying with something like the gaid command, as it is a simple command with obvious results.
      3. 6201.Using 4CC Commands.pdf
    2. Next would be issues with PD/HW
      1. If there is another issue preventing the IC from working properly, this could cause issues.
    3. Far end support
      1. Not all peripherals support the Get Battery message and may fail to respond.

    See an example of get battery status with a PD log below. I connected and tested with two peripherals. One supports the message, while the second does not and sends a not supported message.

    Thanks and regards,

    Chris

  • Hi Chris,

    Can you tell me which software and hardware are you using for tests?

    Warm regard,
    Anas Saeed.

  • Hi Anas,

    I am using a TPS65987EVM with the GUI. The GUI has a "Debug mode" compatible with the evm that allows me to trigger the GBAs command, and I have a couple USB-C PD sink devices I am testing with.

    The logging tool is a totalphase PD analzyer (Specific brand not required or necessarily recommended, it is just what we have on hand).

    Thanks and Regards,

    Chris