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.

BQ76952: How to enter CONFIG MODE ?

Part Number: BQ76952

Tool/software:

Hi everyone, 

I can't enter to config mode with the BQ76952, in fact, I can't write anything to the registers. I've done various test and all registers stay same. The 0x00 Control Status() command returns this value "10010100000000" and 0x12 Battery Status() returns this "1111110010001100" and sometimes it switches to this value "1100010010000100 " . I'm using ESP32 with I2C

I would very much appreciate any help. Thanks :)

#include <Wire.h>

// BQ76952 I2C address (7-bit)
#define BQ76952_I2C_ADDR 0x08

void setup() {
  Serial.begin(115200);
  Wire.begin(21, 22, 400000); 

  delay(2000);

  uint16_t subcmdStatus = readWord(0x00);  
  Serial.print("Subcommand Status (0x00): ");
  Serial.println(subcmdStatus, BIN);  /

  uint16_t batteryStatus = readWord(0x12);
  Serial.print("batteryStatus (0x12): ");
  Serial.println(batteryStatus, BIN);

  delay(500); 

  enterConfigUpdateMode();
}

void loop() {
  delay(1000);  
}

uint16_t readWord(uint8_t reg) {
  Wire.beginTransmission(BQ76952_I2C_ADDR);  
  Wire.write(reg);                           
  Wire.endTransmission(false);               

  Wire.requestFrom(BQ76952_I2C_ADDR, 2);  
  if (Wire.available() == 2) {
    uint8_t lsb = Wire.read();
    uint8_t msb = Wire.read();
    return (msb << 8) | lsb;  
  }
  return 0xFFFF;  
}

void enterConfigUpdateMode() {
  writeSubcommand(0x0090);  // ENTER_CFG_UPDATE
  delay(100);

  // Wait for CFGUPDATE bit to be set in BatteryStatus (0x12), bit 0
  bool entered = false;
  for (int i = 0; i < 50; i++) {
    uint16_t batteryStatus = readWord(0x12);
    Serial.print("batteryStatus (0x12): ");
    Serial.println(batteryStatus, BIN);
    if (batteryStatus & (1 << 0)) {
      Serial.println("Entered CONFIG_UPDATE mode.");
      entered = true;
      break;
    }
    delay(100);
  }

  if (!entered) {
    Serial.println("Failed to enter CONFIG_UPDATE mode.");
  } else {
    delay(1000);
    writeSubcommand(0x0092);  // EXIT_CFG_UPDATE
    delay(100);
    Serial.println("Exited CONFIG_UPDATE mode.");
    delay(1000);
    uint16_t batteryStatus = readWord(0x12);
    Serial.print("batteryStatus (0x12): ");
    Serial.println(batteryStatus, BIN);
  }
}

void writeSubcommand(uint16_t command) {
  Wire.beginTransmission(0x08);               // Correct I2C address (0x08)
  Wire.write(0x3E);                           // Subcommand register (0x00)
  Wire.write((byte)command & 0x00FF);         // LSB
  Wire.write((byte)(command >> 8) & 0x00FF);  // MSB
  Wire.endTransmission();
  delay(10);  // Short delay after sending
}

1447.SCH_Schematic1_2025-04-03.pdf

  • Hi Adam,

    You had successful communication which means BQ76952 was not in shutdown or TS2 soft-shutdown mode. 

    "1111110010001100" indicates you have protection triggered. Maybe you can add some delay from BQ76952 powerup before enter CFG_UPDATE mode. 300ms is a good start. Then, read battery status at first to see if any protections triggered.

    BRs

    Kian

  • Hey Kian,

    Thanks for the reply!

    I added the delay but nothing changed. Could I ask, after entering the CFG_UPDATE mode, shouldn't the last bit of the Battery Status() command be 1? "1100010010000100"  vs  "1100010010000101" . And the bit 15 should show 0 if not in sleep mode, but in every measurement it is 1.

  • And for some reason the SEC1 and SEC0 bits are both 0 indicating that the device has not initialized yet. How can I solve this problem?

  • Hi Adam,

    Yes, the last bit of 0x12 battery status() will be set if device entered CFG_UPDATE mode. The bit 15 isn't important in this issue. You should check the bit 13,12 and bit 8-9. 

    Could you check the REG18 voltage during the startup? And, could you export the transaction log of your operation?

    BRs

    Kian

  • Hi Kian,

    The bit 13, 12 are both zero and bit 8, 9 are also both zero. 

    The REG18 voltage stays stable at 1.8V. 

    Could you please clarify what the transaction log is and what data it needs to have? I have a custom code thus I'm not exactly sure what it is. 

    Thanks. 

    Best

    Adam

  • Hi Adam,

    The logic analyzer transaction log in excel format is good to me. Or, you can check your code on BQ76952EVM

    BRs

    Kian

  • Hey Kian, 

    I don't have the BQ76952EVM dev board. Just a custom PCB with the BQ7695202 chip on it, are there any registers that I can read that will help us figure out the problem and then post them here? 

    Best

    Adam

  • Hi Adam,

    I suggest you buy a EVM on ti.com. I suggest you check the REG18 voltage to see if it is always stable.

    If yes, battery status is the critical register to show the status of AFE. You also need double check if AFE acknowledge to your subcommand. 

    A logic analyzer log is helpful to analyze the comms error. 

    BRs

    Kian