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.

TPS25751: battery level < 20%, Stop discharging external devices

Part Number: TPS25751
Other Parts Discussed in Thread: BQ25798

Tool/software:

Hi teams,

When the battery level is less than 20%, We used the following method to stop supplying power to external devices
① MCU writes to TPS25751 Transmit Source Capabilities (reg 0x32) and configures the following field where applicable:

②Set Number Valid PDOs [2:0] to 0x1 (only advertise first PDO of 5V)

③ Set Maximum Current [33:24] in Source PDO 1 from the default (i.e. 3A) to 0x0 (0A)

④ MCU send 'SSrC' to re-send the updated Source Capabilities to only advertise 5V/0A


But during our tester testing, we found that iPhone and HUAWEI phones can stop charging when the battery level is less than 20%, but other Android phones such as Samsung, Sony, and Google Pixel 6 cannot stop charging

Best Regards!

Iris

  • Hi Iris, 

    But during our tester testing, we found that iPhone and HUAWEI phones can stop charging when the battery level is less than 20%, but other Android phones such as Samsung, Sony, and Google Pixel 6 cannot stop charging

    Can you elaborate  what do you mean by cannot stop charging? Are you seeing the Android phones (Samsung, Sony, Google) are still drawing current when TPS25751 advertises 5V/0A? Are you able to provide PD logs or analog waveform of this behavior? 

    Thanks and Regards,

    Raymond Lin

  • PD.txt

    Hi Raymond Lin,

    Yes, I see that Android phones (Samsung, Sony, Google) are still consuming electricity when TPS25751 advertises 5V/0A;When the battery level is less than 20, the speaker should stop charging the phone, but in fact, it is not. The speaker is still charging Android phones (Samsung, Sony, Google)

    You can filter the log of "frame contacts" [soc] "| | frame contacts" [MSDK_BSP_PBM] ". When the SOC is 19, the current should be close to 0A, but at this time, the current is still over 1A

    Best Regards!

    Iris

  • Hi Iris, 

    Do you have logs of the I2C traffic between MCU->PD and PD->BQ when the MCU updated the PD source caps to only advertise 5V/0A? I would like to see what the BQ IOTG limit is set to when a new contract is negotiated. 1A  current draw from the phones is relatively high for a 5V/0A contract. 

    Can you also provide the JSON file you're using for the PD config? 

    Thanks and Regards,

    Raymond Lin

  • Hi Raymond Lin,

    ①We set the initial value of the REG0D_SOTG_regulation Register (Offset=Dh) to 0x4A, which means the IOTG current is 3120mA

    {
      "questionnaire": {
        "device": "TPS25751",
        "toolBuildVersion": "1.1.0",
        "answers": [
          null,
          1,
          0,
          1,
          1,
          1,
          3,
          0,
          0,
          1,
          1,
          0,
          0,
          0,
          8.4,
          2.4,
          0.24,
          0.96,
          0
        ],
        "vendorId": "0000",
        "productId": "0000",
        "version": "1.0.0.2"
      },
      "configuration": {
        "data": {
          "selected_ace": [
            {
              "register": 6,
              "data": [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ]
            },
            {
              "register": 22,
              "data": [
                10,
                16,
                0,
                0,
                0,
                0,
                0,
                16,
                0,
                0,
                0
              ]
            },
            {
              "register": 40,
              "data": [
                2,
                25,
                46,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                3
              ]
            },
            {
              "register": 41,
              "data": [
                18,
                80,
                145,
                0
              ]
            },
            {
              "register": 50,
              "data": [
                1,
                170,
                42,
                44,
                145,
                1,
                38,
                44,
                145,
                1,
                0,
                44,
                177,
                4,
                0,
                244,
                65,
                6,
                0,
                244,
                177,
                4,
                224,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ]
            },
            {
              "register": 51,
              "data": [
                2,
                44,
                145,
                1,
                16,
                44,
                209,
                2,
                0,
                44,
                177,
                4,
                0,
                44,
                65,
                6,
                0,
                69,
                65,
                6,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ]
            },
            {
              "register": 55,
              "data": [
                59,
                192,
                18,
                20,
                180,
                144,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ]
            },
            {
              "register": 66,
              "data": [
                26,
                0,
                8,
                0
              ]
            },
            {
              "register": 92,
              "data": [
                206,
                12,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                2,
                0,
                0,
                0,
                0,
                4,
                0,
                0,
                0,
                4,
                0,
                0,
                0,
                0,
                0,
                0,
                48,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                50,
                0,
                0,
                0,
                0,
                156,
                155,
                0,
                0,
                0,
                0,
                0
              ]
            },
            {
              "register": 112,
              "data": [
                0
              ]
            },
            {
              "register": 119,
              "data": [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                127,
                0
              ]
            },
            {
              "register": 120,
              "data": [
                0,
                0,
                0,
                128
              ]
            },
            {
              "register": 122,
              "data": [
                0,
                0,
                0,
                0
              ]
            },
            {
              "register": 123,
              "data": [
                0,
                2,
                255,
                255,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ]
            },
            {
              "register": 125,
              "data": [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ]
            },
            {
              "register": 126,
              "data": [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ]
            },
            {
              "register": 152,
              "data": [
                1,
                0,
                1,
                0,
                2,
                21,
                158,
                36,
                143,
                170,
                6
              ]
            }
          ]
        }
      }
    }

    Json file as shown in the "PD_IRQ_Priority_20250717.html"

    ③Sorry, there are no logs related to I2C traffic between MCU ->PD and PD ->BQ,The relevant codes are as follows

    static int command_SSrC(const msdk_device_t *dev)
    {
        uint8_t fourCCData[5];
        fourCCData[0]=0x04;
        fourCCData[1] = 'S';
        fourCCData[2] = 'S';
        fourCCData[3] = 'r';
        fourCCData[4] = 'C';
        MSDK_LOG_INF("\r\n COMMAND SSrC");
        return write_reg(dev,TPS25751_I2C_COMMAND_REG, fourCCData,5);
    }
    int tps25751_set_maxium_current(const msdk_device_t *dev,bool enable)
    {
        uint8_t enable_data[6] = {0x3F, 0x01, 0xAA, 0x2A, 0x2C, 0x91};
        uint8_t disable_data[6] = {0x3F, 0x01, 0xAA, 0x2A, 0x00, 0x90};
        int ret;
    
        if (enable) {
            ret = write_reg(dev, TPS25751_TX_SOURCE_CAPS_REG, enable_data, sizeof(enable_data));
            if (ret != MSDK_STATUS__OK) {
                MSDK_LOG_ERR("Failed to set maxium current");
                return ret;
            }
        } else {
            ret = write_reg(dev, TPS25751_TX_SOURCE_CAPS_REG, disable_data, sizeof(disable_data));
            if (ret != MSDK_STATUS__OK) {
                MSDK_LOG_ERR("Failed to set current:0A");
                return ret;
            }
    
        }
    
        return command_SSrC(dev);
    }

    Best Regards!

    Iris

  • Hi Iris, 

    We set the initial value of the REG0D_SOTG_regulation Register (Offset=Dh) to 0x4A, which means the IOTG current is 3120mA

    Just to clarify, is your MCU overriding the BQ IOTG (automatically configured by PD) to 3120mA when TPS25751 is advertising 5V/0A as the source? This sets the limit way higher and any uncompliant phone can still overdraw the negotiated limit. 

    Because TPS25751 cannot control how much current the phone draws, what is the expected result with these non-compliant phones? 

    Thanks and Regards,
    Raymond Lin

  • Hi Raymond Lin,

    Just to clarify, is your MCU overriding the BQ IOTG (automatically configured by PD) to 3120mA when TPS25751 is advertising 5V/0A as the source? This sets the limit way higher and any uncompliant phone can still overdraw the negotiated limit. 

    REG0D_SOTG_regulation Register was only initialized during the initialization of charger (BQ25798), and was not reset when TPS25751 is advertising 5V/0A as the source (both PD and charger are connected to MCU and work independently)

    Because TPS25751 cannot control how much current the phone draws, what is the expected result with these non-compliant phones?

    The expected result is also that when SOC<20, PD stops charging the phone

    Best Regards!

    Iris

  • Hi Iris, 

    Based on your JSON configuration, are you using your own MCU to control BQ25798? For the SOC<20 scenario, you'll need to set BQ25798 IOTG limit to 0A (or the lowest setting possible) when advertising 5V/0A. Since TPS25751 does not control the current draw from phone (and does not set the IOTG limit), your SoC/MCU needs to configure BQ25798 accordingly to prevent current draw at system low battery.

    Let us know if you have any further questions or concerns! 

    Thanks and Regards,

    Raymond Lin

  • Hi Raymond Lin,

    We set the current of IOTG to the minimum value of 160ma, but it still did not solve the problem of stopping charging. Therefore, we used disable/enable PD to stop and resume charging external devices

    Best Regards!

    Iris

  • Hi, 

    Raymond is currently out of office. Please allow for some delay in responses. 

    Best Regards, 

    Aya Khedr

  • Hi Iris, 

    TPS25751 cannot current limit on PPHV and if the power path is completely disabled then there won't be any connection (VBUS will be at 0V). When your system is at <20% battery, are you using TPS25751 PP5V or PPHV to supply the 5V/0A contract? 

    Thanks and Regards,

    Raymond Lin