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.

BQ27220: Configuration not changed in device

Part Number: BQ27220

The example from page 65 in SLUUBD4.pdf from April 2016 has been followed, however, it seems that the device is not reacting as assumed, as the design Capacity stays at the factory default of 3000mAh. Below is a scheme for the data:

Time [s],Packet ID,Address,Data,Read/Write,ACK/NAK
0.000057800000000,0,0xAA,0x00,Write,ACK
0.000189000000000,0,0xAA,0x14,Write,ACK
0.000366000000000,0,0xAA,0x04,Write,ACK
0.005648200000000,1,0xAA,0x00,Write,ACK
0.005779400000000,1,0xAA,0x72,Write,ACK
0.005956400000000,1,0xAA,0x36,Write,ACK
0.020046800000000,2,0xAA,0x00,Write,ACK
0.020178400000000,2,0xAA,0xFF,Write,ACK
0.020356400000000,2,0xAA,0xFF,Write,ACK
0.025643200000000,3,0xAA,0x00,Write,ACK
0.025774200000000,3,0xAA,0xFF,Write,ACK
0.025951200000000,3,0xAA,0xFF,Write,ACK
0.040070400000000,4,0xAA,0x00,Write,ACK
0.040201400000000,4,0xAA,0x90,Write,ACK
0.040378400000000,4,0xAA,0x00,Write,ACK
0.140030800000000,5,0xAA,0x3B,Write,ACK
0.140614200000000,6,0xAB,0x04,Read,NAK
0.150029200000000,7,0xAA,0x3E,Write,ACK
0.150160200000000,7,0xAA,0x9F,Write,ACK
0.160053800000000,8,0xAA,0x3F,Write,ACK
0.160184800000000,8,0xAA,0x92,Write,ACK
0.170027400000000,9,0xAA,0x60,Write,ACK
0.170819400000000,10,0xAB,0xA1,Read,NAK
0.180028000000000,11,0xAA,0x61,Write,ACK
0.180655200000000,12,0xAB,0x24,Read,NAK
0.190045400000000,13,0xAA,0x40,Write,ACK
0.190935400000000,14,0xAB,0x0F,Read,NAK <- Design cap MSB
0.190997000000000,15,0xAA,0x41,Write,ACK
0.191787200000000,16,0xAB,0xCB,Read,NAK <- Design cap LSB
0.200025600000000,17,0xAA,0x40,Write,ACK
0.200156600000000,17,0xAA,0x04,Write,ACK
0.200369400000000,18,0xAA,0x41,Write,ACK
0.200555400000000,18,0xAA,0xB0,Write,ACK
0.220095000000000,19,0xAA,0x60,Write,ACK
0.220226000000000,19,0xAA,0xC7,Write,ACK <- Checksum new
0.230078400000000,20,0xAA,0x61,Write,ACK
0.230209600000000,20,0xAA,0x24,Write,ACK <- Kept length
0.240045400000000,21,0xAA,0x00,Write,ACK
0.240176600000000,21,0xAA,0x91,Write,ACK
0.240353600000000,21,0xAA,0x00,Write,ACK
0.340043400000000,22,0xAA,0x3B,Write,ACK
0.340626800000000,23,0xAB,0x00,Read,NAK
0.350020200000000,24,0xAA,0x00,Write,ACK
0.350151600000000,24,0xAA,0x30,Write,ACK
0.350329600000000,24,0xAA,0x00,Write,ACK

Checksum calculated as:

Temp = (0xFF - Old_ChkSum - Old_DC_MSB - Old_DC_LSB) & 0xFF; = (0xFF - 0xA1 - 0x0F - 0xCB) & 0xFF = 0x84
New_ChkSum = 0xFF - ((Temp + 0x04 + 0xB0) & 0xFF); = 0xFF - 0x38 = 0xC7

Despite the read of 0x0FCB (4043), the value in the the register (0x3C & 0x3D) is still 0x0BB8 (3000)?

Any help on how to change the design capacity?

  • Hi Ole,
    pls see app note below for guidiance.
    www.ti.com/.../slua801
    thanks
    Onyx
  • I have tried to follow the example described on page 5 in slua801, however the Design Capacity stays the same.
    It should be mentioned that the system is not running Linux, so code is not totally comparable, though the signals on the I2C lines are... Though what I am not sure about is the checksum relative to data - is there a way to check that the checksum is correct by a status register?
    Alternatively; do we agree on that the values for the BQ27220 are (relative to page 5 in SLUA801): "DC_State" = 0x3E (0x52 in BQ27421), DC_STATE_LENGTH stays at 64 bytes (38 bytes long in BQ27220 => 64). Register 0x61 (MACDataLen) shall not be used in any calculations, nor checksum, as length is 64 bytes. The addressing byte order is MSB, LSB or ? - Address 0x929F is provided as (in page 65 in SLUUDB4) Address: 0x3E = 0x9F (LSB), Address: 0x3F = 0x92 (MSB), but Design Capacity in same sheet is: Address: 0x40 = 0x04 (MSB), Address: 0x41 = 0xB0 (LSB). Finally for this reply - is there a way to see if the OTP (0x40E7-0x411F) has been locked, and thereby is not writeable anymore?

  • It's a bit different for the bq27220 vs. slua801. See .

    If you want to set design capacity to 4043mAh (=0x0FCB), you have to execute the following sequence:

    1. Enter CFG_UPDATE mode
    2. Write the address AND the parameter data to 0x3E+ (auto increment)
    3. Calculate the check sum: 0xFF - (sum of address and data) OR 0xFF
    4. Write the check sum to 0x60 and the total length of (address + parameter data + check sum + length) to 0x61
    5. Exit CFG_UPDATE mode

    w aa 00 90 00 #CFG_UPDATE
    w aa 3e 9f 92 0f cb # design capacity = 0x0FCB
    w aa 60 f4 06 # 0x9F + 0x92 + 0x0F + 0xCB = 0x020B. 0x020B OR 0xFF = 0x0B. CS = 0xFF - 0x0B = 0xF4; 2 bytes address, 2 bytes data, 1 byte check sum, 1 byte length = 6
    w aa 00 92 00 #EXIT_CFG_UPDATE

  • Proposed solution works - Thanks !!!

    Just an advice – update the datasheet for the bq27220 ;-) Process is even simpler than described in the document with fewer steps and a more intuitive approach.

    Regards
    Ole