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.

BQ27Z561-R2: bq27z561-R2. Dsg/Chg Current Thresholds NOT reading back as expected-POSSIBLE ERROR?

Part Number: BQ27Z561-R2
Other Parts Discussed in Thread: BQSTUDIO, BQ27Z561

Tool/software:

Hello,

Trying to manually read these data flash items to print out and confimr their set correctly. They current do not come back as the same value as read back by bqstudio (default values on bqstdudi). I have not written these.

Yeah, they remain the same even after writing. I think the address that is listed in the TRM is not what it actually is can someone at TI please confirm?



  • Hello Craig, 

    Can you please confirm with me how you are writing to the gauge, what you are writing to the gauge, and how you are reading from the gauge? 

    Regards, 

    Jonny. 

  • My own interface code, Note the following items minus the dsg/chg read out fine (my code works). So I'm looking for confirmation of the address in documentation matches what the gui is actually calling.

    MOD_MENU_Transmit("\r\nGas Gauging info:\r\n", 0, 10);

    //Design capacity mAh
    if(2!=__bq27z561_read_data_flash(address, pData, 2))
    {
    printk("fail\r\n");
    return;
    }
    address = address+2; //not consecutive here

    msb = pData[1];
    lsb = pData[0];
    value = msb<<8;
    value = value | lsb;

    MOD_MENU_Transmit("\r\nDesign Capacity mAh: ", 0, 10);
    MOD_STRINGS_int64_to_string(value, menu_buf, 16);
    MOD_MENU_Transmit(menu_buf, 0, 10);
    MOD_MENU_Transmit("\r\n", 0, 10);


    //design capcacity CentiWattHours
    if(2!=__bq27z561_read_data_flash(address, pData, 2))
    {
    printk("fail\r\n");
    return;
    }
    address = address + 2;

    msb = pData[1];
    lsb = pData[0];
    value = msb<<8;
    value = value | lsb;

    MOD_MENU_Transmit("\r\nDesign Capacity cWh: ", 0, 10);
    MOD_STRINGS_int64_to_string(value, menu_buf, 16);
    MOD_MENU_Transmit(menu_buf, 0, 10);
    MOD_MENU_Transmit("\r\n", 0, 10);



    The below was originally configured as the same above...but did not readback correctly...So I
    manipulated the below thinking maybe it was a casting issue...



    //get dishcarge current threshold
    address = 0x4721;
    if(2!=__bq27z561_read_data_flash(address, pData, 2))
    {
    printk("fail\r\n");
    return;
    }
    //address = address + 2;

    msb = pData[1];
    lsb = pData[0];
    val_166 = 0;
    //printk("value_166 is %u\r\n", val_166);
    val_166 = (msb<<8)&0xff00;
    //printk("value_166 is %u\r\n", val_166);
    val_166 = val_166 | (lsb);
    //printk("msb %u\r\n", msb);
    //printk("lsb %u\r\n", lsb);
    //printk("value_166 is %u\r\n", val_166);

    val_64 = val_16;

    MOD_MENU_Transmit("\r\nDsg (discharge) current threshold mA: ", 0, 10);
    if(0<MOD_STRINGS_int64_to_string(val_166, menu_buf, 16))
    {
    MOD_MENU_Transmit(menu_buf, 0, 10);
    }
    MOD_MENU_Transmit("\r\n", 0, 10);

    //get charge current threshold

    bq27z561_wait__(50);
    address = 0x4723;
    if(2!=__bq27z561_read_data_flash(address, pData, 2))
    {
    printk("fail\r\n");
    return;
    }
    //address = address + 2;

    msb = pData[1];
    lsb = pData[0];
    value = msb<<8;
    value = value | lsb;

    MOD_MENU_Transmit("\r\nChg (charge) current threshold mA: ", 0, 10);
    MOD_STRINGS_int64_to_string((int64_t)value, menu_buf, 16);
    MOD_MENU_Transmit(menu_buf, 0, 10);
    MOD_MENU_Transmit("\r\n", 0, 10);
  • Hello Craig, 

    The addresses should match what bqStudio is calling. You can double check this by using a logic analyzer to probe the comms lines when you send the commands using bqStudio. 

    Regards, 

    Jonny.