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.

BQ27510: Reading Operation Configuration Register

Other Parts Discussed in Thread: BQ27510, BQ27510-G2

For some reason I can't get following simple implementation to work.

    // read BQ27510 Operation Configuration Register

         for (i = 0; i < BQ2710_DFFS_BLOCK_SIZE; i++) data[i] = 0x00;
    data[0] = 0x00;
    result = I2C_write(0xAA, 0x61, data, 1); //0x61 0x00 cmd=BlockDataControl(), data=0x00
    delay_us(66); // 66 us delay

    data[0] = 64;
    result = I2C_write(0xAA, 0x3E, data, 1); //0x3E 0x40 cmd=DataFlashClass(), data=64
    delay_us(66);

    data[0] = 0x00;
    result = I2C_write(0xAA, 0x3F, data, 1); //0x3F 0x00 cmd=DataFlashBlock(), data=0x00
    delay_us(66);

    result = I2C_read(0xAA, 0x40, 0, 0, data, 32); //0x40 BlockData()

    // low level I2C routine takes care of setting address bit0 to 1

read data contains 0x7E 0x2E 0x31 0x2E 0x30 0x30 0x2D 0x00... which is in ASCII "~.1.00." These chars are part of the ManufacturerInfoBlockA which conatains string "v.1.00-20110907". Entering the same sequence in bqEasy/I2C Pro gives reasonable result (0x09 0x79...). Two first bytes are the same if I read only two bytes which should contain the register contents.

IC is in full access mode (not SEALED) and my functions I2C_write()/I2C_read() work otherwise OK i.e. I can write and read standard commands as well as For ex. ManufacturerInfoBlockA. Obviously I am doing something wrong but can somebody point out how to proceed...

  • Still having difficulties reading Operation Configuration Register. I did some debugging on low level I2C and here is the sequence I traced:

    M: [S] 0xAA     0x61     0x00 [N][P]            // Master sends 0x61 0x00  BlockDataC0ntrol()
               \   /    \   /
    S:          [A]      [A]

    M: [S] 0xAA     0x3E     0x40 [N][P]            // Master sends 0x3E 0x40  DataFlashClass() 64
               \   /    \   /
    S:          [A]      [A]

    M: [S] 0xAA     0x3F     0x00 [N][P]            // Master sends 0x3F 0x00  DataFlashBlock() 0
               \   /    \   /
    S:          [A]      [A]

    M: [S] 0xAA     0x40     [Sr]0xAB      [N][P]   // Master sends 0x40       BlockData() 0x40
               \   /    \   /        \    /
    S:          [A]      [A]          0x7E          // Slave responds 0x7E

    M: [S] 0xAA     0x41     [Sr]0xAB      [N][P]   // Master sends 0x41
           BlockData() 0x41
               \   /    \   /        \    /
    S:          [A]      [A]          0x2E          // Slave responds 0x2E

    The strange issue is that if I change the Manufacturer Info Block A (reading and writing works OK) the slave responses in above sequence also change which means that my sequence does not read the Operation Configuration Register at all. No NACK or error occured on I2C operations. IC is BQ27510-G2, f/w version 1.23.

    I can't figure out what I am doing wrong, please advice!

  • If you can successfully perform that sequence manually using I2C Pro then I would suggest trying longer delays in your code first.

    However, I'm not sure why the same sequence for reading MfgInfoBlockA works but doesn't work for reading the OpConfig from Dataflash.

  • Delay is not the issue while I have stepped through the code in debugger. Delay between write commands is about the same as when entering the commands in I2C Pro.

    Can you please confirm that the I2C sequence above is correct. In I2C Pro I can only verify the commands and their order but I do not see what is happening in I2C bus. I do not like to start to examine the I2C bus between EVM2300 and evaluation PCB, you (=TI) should be able to release unambiguous documentation regarding BQ27510 Data Flash Interface. Current documentation is not very clear and even though I tried to follow documented sequence, for some reason it does not work. I even managed to read Device Name through Data Flash Interface with similar commands as presented above (not using appropriate DeviceName() command), but not OpConfReg. I appreciate a lot if you can supply a simple sample code just to read BQ27510 OpConfReg value (functionality is at least coded in bqEasy sw, perhaps you can copy/paste just the few lines where the read commands are sent to I2C and how the result is read) .

    I hope indeed that this is not a bug in BQ27510-G2 v.1.23 fw, perhaps some other user can confirm that reading the register values works as documented...

  • I reply to myself: the problem was on the lowest level i.e. the chip itself (firmware?) was somehow corrupted even though it seemed to be in working condition. Only reading the Operation Configuration Register failed, all other standard functions and reading data flash blocks gave reasonable results. Anyhow after changing the chip on PCB also my OpConfReg reading routine started to work. The root cause for failure is unknown, perhaps during debugging I did some illegal operation. Flashing the original firmware would also be a solution but in my case it was not possible. This invisible f/w failure caused 2-3 days extra work to me, my advice to other developers is always to try to test the s/w with other PCB/IC in case of unexpected strange behaviour of BQ27510-G2.

    One final question: how come it is possible to crash the f/w even without going to ROM mode? Is there a way to verify that f/w is in full functional condition?

  • thanx Ari Torpstr..m

    I can't see your full name but your question is as same as me to establish.

    Your writting advice  to me. than you very very much~