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.

BQ76942: Incorrect cell value when reading registers using I2C

Part Number: BQ76942
Other Parts Discussed in Thread: BQSTUDIO

Hi,

I am using the I2C interface at 100kHz, the board reports all values correctly when using the Battery management studio. The problem I have is that when I read the cell voltage values using custom code, cell 8 reports incorrect voltages. From the technical reference manual Table 4-1 , I am reading back the cell voltage directly from address 0x23. Cells 1-7 are read back using the same address values from the table and these report voltages perfectly.

Do I have to apply any calibration coefficients to the cell values read from these addresses or are the addresses reporting cell voltages directly? Can you let me know the difference between my approach and the Battery Studio approach?

Thanks in advance 

Richard

  • Dear Richard,

    Just to double check, are you using an 8S setup? TI does provide code for programming on both the STM32 and MSP430 microcontrollers for I2C. The example code can be found here. I've attached the code for reading cell voltage below. Could you try running some of the example code to determine whether it's an issue on your device configuration (i.e. maybe the device is expecting 400kHz I2C or SPI, and you are trying to use 100kHz I2C) or simply incorrect code on your end? It is worth noting that BQStudio can automatically adapt to handle what protocol works with your device. Could you share you exact device number, like bq7694202?

    uint16_t BQ769x2_ReadVoltage(uint8_t command)
    // This function can be used to read a specific cell voltage or stack / pack / LD voltage
    {
    	//RX_data is global var
    	DirectCommands(command, 0x00, R);
    	if(command >= Cell1Voltage && command <= Cell16Voltage) {//Cells 1 through 16 (0x14 to 0x32)
    		return (RX_data[1]*256 + RX_data[0]); //voltage is reported in mV
    	}
    	else {//stack, Pack, LD
    		return 10 * (RX_data[1]*256 + RX_data[0]); //voltage is reported in 0.01V units
    	}
    
    }
    void BQ769x2_ReadAllVoltages()
    // Reads all cell voltages, Stack voltage, PACK pin voltage, and LD pin voltage
    {
      int cellvoltageholder = Cell1Voltage; //Cell1Voltage is 0x14
      for (int x = 0; x < 16; x++){//Reads all cell voltages
        CellVoltage[x] = BQ769x2_ReadVoltage(cellvoltageholder);
        cellvoltageholder = cellvoltageholder + 2;
      }
      Stack_Voltage = BQ769x2_ReadVoltage(StackVoltage);
      Pack_Voltage = BQ769x2_ReadVoltage(PACKPinVoltage);
      LD_Voltage = BQ769x2_ReadVoltage(LDPinVoltage);
    }

    Best,

    Asher Nederveld

  • Hi Asher,

     Thank you for the reply. I can't see a substantial difference between your approach and ours. We are investigating further. 

    Regards

    Richard

  • Dear Richard,

    How far off are is your cell 8 voltage? Is it an holding one incorrect value or is it varying in value with time? Since it seems to be some form of software error, could you share the function you are using to read cell voltages? One thing to consider is that if you short any cells, iterating with a FOR loop through the cells won't work properly unless its set up to skip the addresses of the skipped cells.

    Best,
    Asher Nederveld