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.

BQ27Z561EVM-011: The control issue and spec understanding

Part Number: BQ27Z561EVM-011
Other Parts Discussed in Thread: BQ27Z561, BQSTUDIO, EV2400, BQ27Z561-R2

Hi team,

I have a few questions wanna figure out:

1. In the chapter [Communications] I2C Interface, the figure shows the (b) Quick read R/W bit is sent by slave, isn't it sent by master?

2. I wanna confirm if my understanding is correct, here's an example:

If I want to read the [ChemID], I should write: S 0xAA 0 A 0x3E A 0x06 A 0x00 A Sr 0xAA 1 A 0x3E A 0x06 A 0x00 [A Byte1 A Byte2(return by slave)] N P

am I right?

3. Does this kit support [Static Safety DF Signature]?

Thanks.

Josh

  • Hello John,

    Can you provide the document name/reference/link?

  • sluuc54b(BQ27Z561).pdf

    Hi Shirish,

    The attach is BQ27Z561.

    Thanks.

    Josh

  • Hello Josh,

    We will respond by the end of the day tomorrow, sorry for the delay.

    Sincerely,

    Wyatt Keller

  • Hello Josh,

    Yes, you are correct, the R/W should be sent by the master.

    To get the ChemID, you can follow this process when using the Advanced Comm part of BQStudios. First you would write "0x06 0x00" to the starting register "0x3E" at the address "0xAA". Then you would read in 4 bytes from the starting register "0x3E" at address "0xAA". The first 2 bytes read in would be what you have written to the register before, and then the last 2 bytes would be the ChemID. 

    Yes, the kit does support Static DF Signature which is the same I2C communication protocol as the ChemID. 

    Sincerely,

    Nick Richards

  • Hi Nick,

    Thanks for your respond.

    There's another problem.

    In the GUI, for example, when we want to get "ChemID", we would write"0x06 0x00" to the starting register "0x3E" at the address "0xAA" like you said.

    Sometimes it would get the right information like "06 00 10 12...", but sometimes it would return the data format like "54 00 xx xx xx xx xx..."

    The "0x54 0x00" in datasheet is OperationStatus(), was there any step that I went wrong?

    Sincerely,

    Josh

  • Hello Josh,

    I was able to replicate your problem and the problem happened to me in 2 different instances. When
    I tried to read from register 3E without writing to it first, and when I tried to read the ChemID twice
    in a row to quickly.

    I recommend you to make sure you are writing to register 3E and then reading from it. Also, try not to
    do Manufacturer Access System (MAC) commands back to back (example is reading the ChemID) in a short time frame.

    If you try again and "54 00" is returned. Do another command like reading the voltage (0x08), wait a
    little bit, and then try to read the ChemID.

    Sincerely,
    Nick Richards

  • Hi Nick,

    And how long should the interval be that you recommanded between commands if waiting is required?

    If we want to write a program to control it, we can refer your suggestion.

    And I'm curious to ask, how should we interpret the occurrence of "0x54" if the interval between commands is too short?

    Sincerely

    Josh

  • Hello Josh,

    I would recommend waiting atleast 2 seconds between commands.

    I also have a new recommendation for sending MAC commands. When you write to register 3E, the read from register 3E
    needs to happen within 1 second of the write. I have found success in getting the correct value returned when
    doing this.

    I'm not too entirely sure why 0x54 is returned. I'm assuming that the gauge returns 0x54 as a default value when trying
    to read from register 3E.

    Sincerely,
    Nick Richards

  • Hi Nick,

    Thanks for your suggestion!

    Another question:

    Regarding the issue of [Calibration], I'm not quite clear about the format for writing the obtained data back to the data flash after performing calibration (0xF081). Is it necessary to write to each data flash address individually?

    Sincerely,

    Josh

  • Hello Josh,

    Yes, you will need to write back to each address individually. For guidance on writing value
    to the data flash, I would recommend reading section 13.2.42 of the TRM.

    However, I would advise using BQStudio for writing data to data flash.

    Sincerely,
    Nick Richards 

  • Hi Nick,

    The customer provided me with an .srec file for programming. I used BQstudio's programming utility to load the file and clicked on the "Program" button, but I encountered the error message. What could be the possible issue?

    Sincerely,

    Josh

  • Hey Josh,

    Can you send a clear picture of the error you are receiving.

    A common error seen when trying to program an srec file is when the device loses communication.

    Also, make sure to know the difference between the Golden Image tab, and the Programming tab.

    Sincerely,
    Nick Richards

  • Hi Nick,

    This is the error that I received.

    Programming - Unable to open srec or senc file specified in function parameter.

    And after the error, the gauge would sealed.

    Also, I tried to generate a Golden Image, but failed as well.

    By the way, is there any way to develop and program without using Bqstudio - EV2400?

    Sincerely,

    Josh

  • Hey Josh,

    I would recommend upgrading the EV2400 firmware, I see you are running the 0.18 version of the firmware. Please update to the 0.32 version -> https://www.ti.com/tool/EV2400  This could fix your problem.
    Yes, there is a way to program gauges without the EV2400. I will link a document that talks about the format of the flash stream files. You can implement code using your own microcontroller.

    Sincerely,
    Nick Richards

    5164.Flash Stream File Format (4).pdf

  • Hi Nick,

    I have tried to update the 0.32 version but failed.

    It said:

    Error: No Free EV2400s Detected. If one is connected but the LEDs are not on, try running this program with the -s option.

    Press enter to continue...

    And I download the 0.28 version still failed.

    Sincerely,

    Josh

  • Hey Josh,

    Make sure you have the BQStudio application closed when you are updating the EV2400. Also, please update your version of BQStudio.

    Sincerely,
    Nick Richards

  • Hi Nick,

    According to your suggestion, I have updated my version to the 0.32 now, but still can't programming .srec file.

    By the way, my BQStudio is 1.3.101.1, isn't it the latest version?

    Sincerely,

    Josh

  • Hey Josh,

    Try using the BQSTUDIO-TEST version and see if that solves your problem. When you download this, please place it in a different directory on your computer and open the application from that folder.

    Sincerely,
    Nick Richards

  • Hi Nick,

    I have followed your suggestion to install the BQStudio-TEST version and also placed in different directory.

    I thought whether the different between R1 and R2, cause our client is using R1 and we are using R2.

    Sincerely,

    Josh

  • Hey Josh,

    The firmware version shouldn't matter, you should be able to program their R1 srec onto your R2. I ran a test on my end to try to replicate your problem. I  found success in programming a srec file when the gauge went from SEALED to FULL ACCESS. Therefore, I would suggest that you set the gauge to FULL  ACCESS mode before trying to program an srec file. You can verify what mode the gauge is in by checking the SEC1 and SEC0 bits in Operation Status A.  Other things to note is to make sure your gauge is getting a stable power supply and that there are not interruptions in communication to the gauge.

    Sincerely,
    Nick Richards

  • Hi Nick,

    I had already unlocked the gauge to FULL ACCESS. The reason that you saw was "SEALED" is because after I failed programming a srec file, it would go from FULL ACCESS to SEALED.

    And like you said, I have been consistently checking the status of SEC0 and SEC1 to ensure the OperationStatusA 's state.

    My setup environment is power supply 3.6V and 1A, with an electronic load acting as the impedance.

    Sincerely,

    Josh

  • Hey Josh,

    Can you try to program the srec file after putting the gauge in ROM mode. I will share a screenshot of how to put the gauge in ROM mode.

    Sincerely,
    Nick Richards

  • Hi Nick,

    I had tried putting the gauge in ROM mode.

    The gauge information at the left side would gone and I program the .srec file still couldn't.

    I'm not sure if I missed any steps?

    The other question is that we have rework a R1 EVM but the device version seems can't work on BQstudio.

    But I think it should have been detected, just can't access the operating interface.

    Sincerely,

    Josh

  • Hey Josh,

    You can force the gauge to open up the R2 version of the firmware by selecting "1561_2_01-bq27z561R2.bqz", from there you can go on the product page for the BQ27z561-R2 and download the firmware and then program the -R2 srec file onto the gauge. Currently, the -R1 firmware is not available on TI.com, but  should hopefully be available soon.

    Sincerely,
    Nick Richards

  • Hi Nick,

    Thanks.Now I have been able to program the .srec file.

    I have another question: When I calibrate the current, I tried to follow the BQstudio's approach using my own command. I found that besides modifying the value at data flash address 0x4000, it also changes the value at 0x401E. However, the data sheet does not seem to mention the meaning of this address, and when I omit writing to this 0x401E address, the calibration fails. Is there any necessary step in writing data flash that is not mentioned in the documentation?

    Sincerely,

    Josh

  • Hey Josh,

    I did an initial search of that memory memory address in the firmware code for the gauge and was not able to find anything.
    How are you reading the data from the memory address 0x401E. Are you using a logic analyzer? Please explain the steps you are taking.

    Sincerely,
    Nick Richards

  • Hi Nick,

    Yes, I used a logic analyzer for measurement, and I used the 'calibration voltage' feature in BQstudio to input a calibration value of 3600mV. After that, I recorded the following logic.

    Lines 267 and above continuously perform the '0xF081' calibration action. I haven't included individual images for each step. The image shows the final behavior after the calibration process has been completed.

    Doesn't line 284 show '0x401E'? Or am I misunderstanding something? 

    Sincerely,

    Josh

  • Hello Josh,

    I talked to other people on the team and this register seems to be a register that is hidden from the user. As you stated before, you must write to this register  for the calibration to work. Therefore, I would not worry too much about the value being written here and just replicate what you are seeing on the logic  analyzer.

    Sincerely,
    Nick Richards

  • Hi Nick,

    After I was able to use my own program to complete the calibration, I noticed that the error in calibrating the current falls within +-3mA. I am wondering if there are other algorithms for calibrating the current, in addition to the CCgain and Capacity Gain algorithms mentioned in the datasheet, that could provide more precise calibration.

    Sincerely,

    Josh

  • Hey Josh,

    The only way to increase the accuracy of the current reading for the gauge would be to increase the value of the sense resistor for your application. Since you  are using the EVM, it uses a 1mOhm sense resistor. A 3 mohm or 5 mohm sense resistor will increase the accuracy. For a 1 mohm sense resistor application,  we expect the error in current readings to be about 2 to 3 mA.

    Sincerely,
    Nick Richards

  • Hi Nick, 

    Thanks.I'll try it.

    You previously provided information about the "5164.Flash Stream File Format," which describes the programming format for .bqfs files. Is there a similar format for .srec files? Because BQstudio uses .srec files for programming, and I would like to know if it's possible to use my own method to program .srec files.

    Sincerely,

    Josh

  • Hello Josh,

    BQStudio uses both bq.fs or srec files. You can use your own method to program the srec file but the formatting is not in TI's control like the flash stream, so you will need to reference the Motorola SREC file format to create program the srec. The flash stream file has more examples and is easier to parse.

    Sincerely,

    Wyatt Keller

  • Hi Wyatt,

    I have successfully used the .srec file for programming and monitored the waveform using a logic analyzer to obtain some data, but I have a few questions regarding the observations:

    1. What does the initial write of 00 33 00 signify?
    2. To enter the ROM mode, isn't it necessary to write 0x0F00 first? Why can the second line directly write to ROM address 0x16?
    3. During the write process, why is the data length repeatedly divided into lengths of 1F and 05? Why not write all 36 bytes at once?

    Here are the reference pictures.

    Sincerely,

    Josh

  • Hello Josh,

    Command 0x0033 also send the device to ROM mode, this is for backwards compatibility with older gauges.

    In ROM mode the gauge uses structure more similar to SMBus and the address changes to 0x16 instead of 0xAA.

    I'm not sure exact reasoning why it is split up this way with different sized block writes, it may also be for some type of legacy support.

    Sincerely,

    Wyatt Keller

  • Hi Wyatt,

    This is a partial .srec file, in which there are quite a few occurrences of 0x00 and 0xFF whose meanings are not known. However, these values are not observed being written in the logic analyzer. Do I need to write these values when implementing the programming of the file?

    Here are the reference pics.

    Thanks.

    Sincerely,

    Josh

  • Hello Josh,

    The Motorola SREC file formatting is not controlled by TI, so if you have an SREC uploader code it may be parsing areas of 0x00 and 0xff in the file as a "do not upload" condition. Check your code which parses and uploads the SREC file.

    Sincerely,

    Wyatt Keller

  • Hi Wyatt,

    Thanks for your help.

    I understand that the Motorola S-record file format is not controlled by TI. However, the .srec file is generated using BQstudio. Therefore, those occurrences of 0x00 and 0xFF might be understood by TI, explaining why that data is present or identifying which parts should be ignored. Without knowing which data is necessary and which is not, we are also unaware of what should be marked as "do not upload".

    Sincerely,

    Josh

  • Hello Josh,

    The entire SREC should be uploaded, I'm not sure why the parser excludes certain regions which are all 0xFF or 0x00, it may be in an effort to try to reduce upload time, in general all lines should be written.

    Sincerely,

    Wyatt Keller