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.

BQ24725: Drive I2C SmBus Communication with STM32F0.

Part Number: BQ24725
We are developing a project that uses STM32F0 as host and BQ24725 with slave.
I would like to know if you can send me the communication drive and set for this component (BQ24725) via I2C STM32F0.
 Following email address:
julio.cs.goulart@gmail.com
  • Hi,

    Please take a look at pages 15-16 in the datasheet for details about the BQ24725's SMBus interface. This section describes the write-word and read-word protocols, the write/read timings, and the conditions under which SMBus communication is enabled. Table 2 also shows the BQ24725's registers and their default values at POR.

    Please note that the BQ24725 is NRND (not recommended for new designs) and has been replaced by the BQ24725A. We recommend using the BQ24725A instead.

    Best regards,

    Angelo


  • Hi .. Thanks for the reply, I will try to do this.

  • I changed the BQ24725 to BQ24725A as suggested.
    Via I2C I send the commands in the following sequence:
    
    
    
    Addres: 0x12
    
    WRITE-> CHARGE_OPTION reg (0x12): -> POR State Data (0XF902)
    WRITE-> INPUT_CURRENT reg (0x14): -> POR Status Data (0x0000)
    WRITE-> CHARGE_VOLTAGE reg (0x15): -> POR state data (0x0000)
    WRITE-> CHARGE_CURRENT reg (0x3F): -> POR state data (0X1000)
    READ-> MANUFACTURE_ID reg (0xFE): -> POR State Data (0X0040)
    READ-> DEVICE_ID reg (0xFF): -> POR state data (0x0000)
    
    
    waith 500ms;
    
    Addres: 0x12
    
    WRITE-> CHARGE_OPTION reg (0x12): -> POR Status Data (0X8132)
    WRITE-> INPUT_CURRENT reg (0x14): -> POR State Data (0x0580)
    WRITE-> CHARGE_VOLTAGE reg (0x15): -> POR Status Data (0X41A0)
    WRITE-> CHARGE_CURRENT reg (0x3F): -> Status Data BY (0X0A00)
    READ-> MANUFACTURE_ID reg (0xFE): -> POR State Data (0X0040)
    READ-> DEVICE_ID reg (0xFF): -> POR state data (0X000B)
    
    
    Through the oscilloscope I see all the ACKs, but the BQ24725A doesn't work, "doesn't charge the battery".
    What could be wrong?
  • Hi,

    Can you please check whether the conditions listed below are true? All of these conditions must be met in order to enable charging:

    Also, what is your adapter voltage? Your charge voltage register is set to 16.8 V. Since the BQ24725A is a buck charger, the adapter voltage must be higher than the max charge voltage.

    Best regards,

    Angelo

  • Hi Angelo.


    I did the measurements that you suggested, below:

      Without Adapter With Adapter
    Adapter Volt  0V 19.5V
    Ilim 0V 819mV
    REGN 0V 6V
    ACDET 0V 2,58V
    ACOK 0V 3,2V


    I noticed that when I give the read command of the values ​​that were written, the values ​​come very different. reading ManufacturerID () gives the data: 0x0000 and DeviceID () brings the data: 0x0000. A basic question, I am using I2C and not SMBus, can this be the problem?

  • Hi,

    Yes, it's possible that you are not writing to the registers correctly. Since the ChargeCurrent and ChargeVoltage registers are both zero at POR, there will be no charging until a valid value is written to these registers.

    Can you read back all the register values to see if the values you wrote actually went through?

    Best regards,

    Angelo

  • Ok, solved this problem.
    When reading the data already sent, I noticed that they were inverted the high part with the low part.
    write 0xF902
    read 0x02F9.
     so I used the swap and started loading.

    ------------ uvision STM32F0 command: HAL_I2C_Mem_Write(&hi2c1, Addr_Bq24725A,CHARGE_OPTION[0],1 , &CHARGE_OPTION[1],2, 1000); //write
    HAL_I2C_Mem_Read(&hi2c1, Addr_Bq24725A, R_CHARGE_OPTION[0], 1, &R_CHARGE_OPTION[1], 2, 1000); //read
    ------------ Thanks for the collaboration.