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.

TUSB320: Unusual Charging Behavior

Part Number: TUSB320
Other Parts Discussed in Thread: TPS61023,

Hello sir,

I have been using a TUSB320 in DRP mode for my application and using TPS61023 as a boost converter. My battery charging circuitry is working very well. But when I try to charge an external device such as mobile phone. Some of the phones shows charging status but they give an option of slow charging. while the other phone do not even give the charging status. It is to be noted that I have configured the CC pins to 1.5A for now. But when I change them to 3A then none of the device shows the charging status. Kindly assist me in this regard. I am attaching my schematic and PCB layout. Thanks

  • Hi Hamza,

    Thanks for reaching out. Can you share the schematic as a PDF? Its difficult to see the details and net names in the image you show.

    I have a couple questions to get a better idea of the issue:

    Some of the phones shows charging status but they give an option of slow charging. while the other phone do not even give the charging status

    1. In your case some of the phones will charge and some will not when the CURRENT MODE is set to 1.5A?

    when I change them to 3A then none of the device shows the charging status

    2. When you configure the CURRENT_MODE for 3A, then your phone does not charge from the port at all?

    3. How do you control the Type-C VBUS? The VBUS should only be enabled when ID on the TUSB320 goes low.

    Best,

    Shane

  • Hello, Thanks for your time. Yes I am sharing my schematic in PDF so you can view it.

    CO_Detector.PDF

    The answers to your questions are below.

    In your case some of the phones will charge and some will not when the CURRENT MODE is set to 1.5A?

    1. Yes, I have set the CURRENT MODE to 1.5A (Code snippet attached below for configuring the current mode). Actually I was testing my circuit so I connected a phone from Xiaomi Redmi Note 12. While the other phone was from Apple which is Iphone15. When I connect the cable, Xiaomi  phone shows the status of charging but after around 1 min it shows a message which says that "Phone charging slowly. Check your cable or charger". While on the other hand Apple device doesn't even shows the charging status. I have also connected a Samsung Phone it was also showing slow charging status. However I have checked the voltages at VBUS they are around 5.07V.

    void usb_currentselector()

    {

    uint8_t data = 0x40;

    HAL_I2C_Mem_Write(&hi2c2, (0x60<<1), 0x08, 1, &data, 1, 1000);

    }

    When you configure the CURRENT_MODE for 3A, then your phone does not charge from the port at all?

    2. As I have mentioned earlier that the phone was showing the slow charging status for that purpose I have set CURRENT MODE to 3A but now when I have set that I have connected the Xiaomi device but it wasn't charging. I have also connected some other devices as well but no sign of charging at all. I can also understand that TPS61023 couldn't provide 3A current but it does provide 1.5A so why TUSB320 couldn't provide the desired current to charge the phone.

    How do you control the Type-C VBUS? The VBUS should only be enabled when ID on the TUSB320 goes low.

    3. Well currently in my design I have pulled up the ID pin. So it is high. I am controlling the VBUS by using the CC pins.

    Thanks

  • Hi Hamza,

    From your schematic, I don't see a VBUS switch between your 5V power rail and the Type-C VBUS:

    In a type-C port, VBUS should only be applied after a connection is made on the CC lines. When this connection is made, our TUSB320 will pull the ID pin low. When ID is low your VBUS switch should apply the VBUS. Here is a good resource on how to control the VBUS on a type-C port with the TUSB320.

    why TUSB320 couldn't provide the desired current to charge the phone.

    The TUSB320 does not supply current to the Type-C port. The CURRENT_MODE pin will only tell the connected device what current to expect on the VBUS. The actual VBUS would be provided through your VBUS switch and power supply.

    Can you show a block diagram of the power path from your supply to the Type-C VBUS? I want to be sure I didn't miss anything in the schematic.

    Best,

    Shane

  • Hi Shane,

    Thanks for your assistance but I need to make some of the things easier for you that at the moment R59 is DNP. While P1 is configuration PAD which makes a selection between 5V_1.5A and 5V_3A source. For the time being I am using 5V_1.5A so source and 5V_1.5A  are soldered. Picture is attached for better understanding.

    I don't see a VBUS switch between your 5V power rail and the Type-C VBUS:

    The switching is performed in the software using TUSB320 registers. But a small circuit is also added which shows that when does VBUS will be provided. The external device only charges(VBUS provided ) if the EXT_DEV_CHRG_EN pin is set to high.  I am attaching a code snippet and switching circuit so you can review it. Thanks.

    Please let me know if you find any errors in schematic or in the code. So I can fix it. Currently my issue is that some devices are charging and some or not. However I have read the DEVICE_ID and its working fine.

    uint8_t usb_cabledetect_statedetect()

    {

    uint8_t wr_addr[3] = {0x08,0x09,0x0A};

    uint8_t cable_nd_state_detection[3];

    uint8_t flag =2;

    for(int i=0;i<3;i++)

    {

    HAL_I2C_Mem_Read(&hi2c2, 0x60<<1, wr_addr[i], 1, &cable_nd_state_detection[i], 1, 1000);

    }

    if(cable_nd_state_detection[1] & 0x40) // External Device charging

    {

    HAL_GPIO_WritePin(EXT_DEV_CHRG_EN_GPIO_Port, EXT_DEV_CHRG_EN_Pin, GPIO_PIN_SET);

    HAL_GPIO_WritePin(CHG_EN_GPIO_Port, CHG_EN_Pin, GPIO_PIN_RESET);

    flag =1;

    }

    else if(cable_nd_state_detection[1] & 0x80) // Battery Charging

    {

    HAL_GPIO_WritePin(EXT_DEV_CHRG_EN_GPIO_Port, EXT_DEV_CHRG_EN_Pin, GPIO_PIN_RESET);

    HAL_GPIO_WritePin(CHG_EN_GPIO_Port, CHG_EN_Pin, GPIO_PIN_SET);

    flag = 0;

    }

    else // None

    {

    HAL_GPIO_WritePin(EXT_DEV_CHRG_EN_GPIO_Port, EXT_DEV_CHRG_EN_Pin, GPIO_PIN_RESET);

    HAL_GPIO_WritePin(CHG_EN_GPIO_Port, CHG_EN_Pin, GPIO_PIN_RESET);

    }

    return flag;

    }

  • Hi Hamza,

    I didn't realize D7 was not populated. Thank you for clarifying.

    Looking at the VBUS switch circuit, your EXT DEV CHRG EN will drive T4 when it goes high. This will pull the gate on T5 to GND and enable the VBUS switch. I assume this means that the EXT DEV CHRG EN signal is active high (VBUS provided when signal is high). Can you confirm?

    If this is the case, I don't see how the gate of T5 gets pulled up to disable the switch after the device is disconnected. When the EXT DEV CHRG EN signal goes low and disables T4, the gate of T5 would be a floating node. Can you check the following:

    1. When you plug in a device do you see T5 (and VBUS) get enabled?

    2. When you detach the device do you see T5 (and VBUS) get disabled?

    Best,

    Shane

  • Hi Shane

    EXT DEV CHRG EN signal is active high

    Yeah  EXT DEV CHRG EN is an active high signal.

    the gate of T5 would be a floating node

    Yeah you got it right that once the device is connected (VBUS is enabled) but when the device is detached the due to floating state at the gate of T5 (VBUS is still enabled). I think that's the issue from my side regarding power switching !!.

    Any suggestions how can make the current circuit work properly regarding charging. I will revise the schematic in near future. Thanks

  • Hi Hamza,

    You could add a weak pullup resistor to the Gate of T5. This should pull the gate of T5 to a high voltage when T4 is disabled and disable the VBUS.

    I hope this helps. Let me know if you have any questions.

    Best,

    Shane