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.

bqfs / dffs programming in C

Other Parts Discussed in Thread: BQ27541

I am trying to write some code to program a bqfs/dffs file into the bq27541 v200 using C over the I2C bus.  I am having problems with the "C" command (read and compare): what I read from the gas gauge is not what is expected in the bqfs line.  I followed the instructions in the slua541a and I enter the ROM mode first, then as the bqfs/dffs files instructs, my code talks to the I2C address of 0x16.  So far I can enter and exit ROM mode successfully, and the "W" command appears to be working.

My questions are:

1) Is there some C example code for programming the bqfs/dffs files into the gas gauge?  I have to write a custom program since we are not using the TI EVSW/EV2300 in production.

2) If I don't want to change the GG firmware version, do I still have to program both the bqfs and the dffs or just the dffs will do?

Thank you.

  • Fixed the problem:

    - I was using some existing libraries that work a bit different than what I expected.

    - Also, note that some of the write lines are longer than 32 bytes in length, which may be larger than the buffer size of your I2C device.

  • Now I have another problem (I found it also on another post, but no answer to it):

    I program the dffs file almost completely (in my case it goes past line 211).  On line 212 I have a C command of the sort "C: 16 66 00".  The value I read back is 0x02 instead of 0x00.  Anyone knows why?

    Thank you.