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.

BQ34Z100-G1: reading “Design Energy Scale” from the bq34z100-G1

Part Number: BQ34Z100-G1

I am using a bq34z100-G1 gas gauge and have the I2C interface implemented between an embedded CPU and the gas gauge. I have a question about reading the “Design Energy Scale” that is in the flash subclass 48 and offset 30.  Using the technical reference guide, I was able to figure out how to read the flash and I can reliability read the design energy scale value from the flash.

My question is did I miss where I can read this value without having to unseal the device, read it via directly from the flash with the subclass and offset and the re-seal it each time? I was going to write the software on the microprocessor side to read the actual scale factor the gas gauge is using and be able to automatically have microprocessor scale any values from the gas gauge as needed.  By having the microprocessor read the actual scale factor and apply it to the readings from the gas gauge, if the golden image ever changes the scale factor, the software on the microprocessor will not need to change.

Did I miss an easier way to read the design energy scale factor without going through the un-seal, read and re-seal? If I really need to unseal the device to read the scale factor and re seal it each time the microprocessor boots, will that hurt the flash memory with by exceeding the flash writes?

Doug

  • Hi Doug,

    You're absolutely correct. The device would need to be sealed and resealed. As a workaround, you may wish to either create a lookup table based upon model number or utilize the manufacturer info block (which is read-only when sealed) to hold this information. The method of access is slightly different when in sealed mode. Please refer to section 7.3.3.2 for information on how to access the manufacturer info block when in sealed mode.

    Sincerely,
    Bryan Kahler
  • Thank you for confirming that. 

    I thought I must have missed something since the only thing the design energy scale does it tell the host microprocessor how to scale the data and it's is not easily accessed by the micro.

    Is there a concern for the flash memory in the gas gauge if I unseal and re re seal it often to read the design energy scale?  I'm thinking if I read it each time the micro boots?  I suppose I could read the scale factor and save it in the micro flash and only update it on the micro if the golden image changes....

    Doug

  • Hi Doug,

    The dataflash isn't written to when the device is sealed/unsealed. The write/read i2c commands are performed in ram. Fortunately, I2c writes don't necessarily correspond to dataflash writes.

    I would be more concerned about leaving the unseal key on the device and unsealing it during operation. I'm sorry the workaround seems a bit silly, but it would allow for just a read with the gauge sealed instead of requiring the device to store and use the unseal key, even if this value (since it is static) would most likely only be checked when connecting the cell to the system, requiring unseal+read+seal.

    Sincerely,
    Bryan Kahler
  • I thought that unsealing and sealing it would write to flash because the device remembers the sealed state.  Anyway, thanks for the advice.

    Doug

  • Hi Doug,

    Not a problem!

    Sincerely,
    Bryan Kahler