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: during programming, writes appear to succeed, but 2nd check fails

Part Number: BQ76952
Other Parts Discussed in Thread: BQSTUDIO

Hello,

I'm programming the chip via I2C and the following struct (a few lines of which are shown here for brevity):

static const uint8_t bq76952_config[] =
{//          cmd  addr  len   data
    (uint8_t)'W', 0x10, 0x03, 0x3E, 0x02, 0x00,
    (uint8_t)'C', 0x10, 0x07, 0x3E, 0x02, 0x00, 0x76, 0x95, 0x00, 0x36,
    (uint8_t)'W', 0x10, 0x03, 0x3E, 0x90, 0x00,
    (uint8_t)'X', 0x05, 0xDC,   // 1500 ms delay
    (uint8_t)'W', 0x10, 0x1E, 0x3E, 0x80, 0x91, 0x57, 0x2F, 0x57, 0x2F, 0x57, 0x2F, 0x57, 0x2F, 0x59, 0x2F, 0x59, 0x2F, 0x59, 0x2F, 0x59, 0x2F, 0x59, 0x2F, 0x59, 0x2F, 0x59, 0x2F, 0x59, 0x2F, 0x5C, 0x2F, 0x5C,
    (uint8_t)'W', 0x10, 0x06, 0x1D, 0x2F, 0x5C, 0x2F, 0x5C, 0x2F,
    (uint8_t)'W', 0x10, 0x03, 0x60, 0x6A, 0x24,
    (uint8_t)'X', 0x00, 0x14,   // 20 ms delay
    (uint8_t)'W', 0x10, 0x03, 0x3E, 0x80, 0x91,
    (uint8_t)'C', 0x10, 0x23, 0x3E, 0x80, 0x91, 0x57, 0x2F, 0x57, 0x2F, 0x57, 0x2F, 0x57, 0x2F, 0x59, 0x2F, 0x59, 0x2F, 0x59, 0x2F, 0x59, 0x2F, 0x59, 0x2F, 0x59, 0x2F, 0x59, 0x2F, 0x59, 0x2F, 0x5C, 0x2F, 0x5C, 0x2F, 0x5C, 0x2F, 0x5C, 0x2F,

The read back of 0x3E is just the subcmd (0x9180) followed by zeros as seen here:

What am I missing?  Longer time delays needed?  Incomplete initialization at top of struct (from BQStudio)?

Regards,

  • Hi David,

    The image isn't showing up clearly and it's not easy for me to understand the execution timing from the code. The latest version of the BQ769x2 Software Development guide gives some recommendations on the timing between commands. I am also attaching working example code for reference.

    sluc701.zip

    Best regards,

    Matt