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.

BQ27427: When initializing the bq27427, where are delays required?

Part Number: BQ27427
Other Parts Discussed in Thread: BQSTUDIO

Tool/software:

We have a new design that is using a bq27427 Battery Gauge.

The gm.fs file produced by Battery Management Studio (V1.3.124, i.e., the latest version) contains code like this to initialize each of the Data Blocks of the Battery Gauge:

But executed literally by our Battery Gauge Initializer subroutine (that just interprets and executes our pre-processed version of that gm.fs file), this doesn't work. It fails the very first time it tries to verify the checksum of a programmed data block.

And when I look at the BQ27427 Technical Reference Manual (SLUUCD5, JANUARY 2023) I instead see this advice for when to introduced delays into the programming steps:

That is, have many more delays than just that one 10 ms delay that Battery Management Studio called for.

And this appears to be good advice: when I add a blind delay after every step of the programming recipe (such that I never advance to the next step without at least 2.5 ms of delay), initializing the Battery Gauge succeeds.

So this leads me to some questions:

  • Is the gm.fs file being produced by Battery Management Studio just plain wrong about the necessary delays?
  • If so, does TI acknowledge this bug and have plans (e.g., a filed bug report) to correct it?
  • And in the meantime, I should follow the advice in the Technical Reference Manual, right?
  • But how short can those delays be? I'm getting away with having them set to 2.5 ms (except for, for example, Step 10 where I'm getting my general 2.5 ms delay PLUS the 10 ms delay explicitly asked for by the gm.fs file). Battery Gauge Initialization happens at every start-up of our device so we hate to have this process take longer than the absolute minimum time required.
  • Is that minimum delay specified in the Data Sheet? (I haven't found it.)
  • Hello, 

    The gm.fs produced by bqStudio should be correct and I have not heard of anyone having any difficulties with it. You should be able to use the routine in the gm.fs to program the golden image to the gauge. 

    Regards, 

    Jonny. 

  • It's possible (in fact, likely) that it works when processed through Battery Management Studio (probably because the tool inherently introduces delays) but if you take the operations that the file commands and execute them as fast as possible as I²C Bus commands, the process fails for the bq27427 Battery Gauge when it gets to the step that would confirm the checksum of a programmed block.

  • Hello, 

    You might be correct here, I would follow the timing recommendations in the TRM. 

    Regards, 

    Jonny. 

  • You might be correct here, I would follow the timing recommendations in the TRM.

    Thanks; that's what I'm (now) implementing.

    But if it turns out that a fair sample of gauges don't need the full 5 milliseconds, I may trim that time a bit. (Our overall startup time is critical to us.) If you know the actual time required, I'd appreciate knowing that.

  • Hello, 

    It is recommended to stick with the spec in the TRM, but if you can try to trim the timing down a bit to see what works for your system. What we have in the TRM is what we know to work, anything outside of that then the functionality is not guaranteed. 

    Regards, 

    Jonny.