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.

BQ4050: Writing Data Flash Memory

Part Number: BQ4050

Hello,

I am having trouble writing the data flash memory. I see that the TRM says to use the ManufacturerBlockAccess() (0x44) command and then write the memory block that you want to access (memory start address: 0x4000-0x5FFF ?) followed by the new value. Is this correct? I have not yet been successful. I have also seen this other thread where it is suggested that you must compute and write a new checksum, like the BQ30 series fuel gauges (e2e.ti.com/.../739212). Can you please direct me to a clear example of how to write and read data flash? I would like to see the full transaction, so that I can fully understand what is required.

Thank you,
Aaron

  • Aaron,

    The TRM is correct. There is no need for a checksum as this device is SMBUS and on SMB devices of this current generation we don't have checksums. You just need the address and format the data correctly to write to any register in the df. For that you also have to be in full access mode.
  • Thank you for the reply. I wasn't sure which security mode I had to be in, so that is helpful. I think I've almost got it.

    Can you clarify, on page 69 of the TRM it demonstrates how to read the HardwareVersion() from ManufacturerData(), but it writes to Command 0x00 and then reads from Command 0x06. Is that a typo, or am I missing something?

    Example: Read HardwareVersion() (0x0003) via ManufacturerBlockAccess()

    1. Send HardwareVersion() to ManufacturerBlockAccess().

    (a) SMBus block write. Command = 0x00. Data sent = 00 03

    2. Read the result from ManufacturerData().

    (a) SMBus block read. Command = 0x06. Data read = 00 01

    (b) That is 0x0100, HardwareVersion() 100.

    The ManufacturerAccess() and ManufacturerBlockAccess() are interchangeable. The result can be read

    from ManufacturerData() or ManufacturerBlockAccess() regardless of how the MAC command is sent.

  • Hi Aaron,

    Yes, that's a typo. It should be 0x23 which is ManufacturerData().
  • I am now successfully reading and writing to the data flash, but my new values (design capacity, design voltage, etc.) don't seem to be sticking. When I read full charge capacity, I still get the default 4400 instead of the 2700 mAh or 1944cWh that I wrote. Is there more to changing data flash than just doing a block write with FULL ACCESS (SEC1 = 0, SEC0 = 1)? Do the changes hold is the device is reset?
  • Yes, the writes should hold if you are in full access. There is no checksum or anything that would prevent writes. The data will be refreshed in RAM when you send a reset command. However, if you were sealed before reset, sending another reset would seal the gauge again.