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.

BQ40Z50: BQ40Z50

Part Number: BQ40Z50
Other Parts Discussed in Thread: BQSTUDIO

Tool/software:

Hi All,

I'm after, hopefully, a bit of a point in the right direction please, I'm trying to program a BQ40Z50 device with the manufacturer serial number at register 1C, from sniffing what happens when BQ Studio writes 0003 we get

From this I tried the MCP2221 command

MCP2221CLI.exe /connectS=0002756608 -smbw=03,03,00,74 -slave8=17 -register=1C -pec=off -speed=100000

It returns back a successful write comment, but when we read out the serial number with 

 -smbr=2 -slave8=17 -register=1C -pec=off -speed=100000

It still says the serial number is default 0001, I can't seem to change it

Thanks in advance for any help and suggestions, I'm sure it's something easy that I have forgot!

Best wishes,

Steve

  • Hello Steve,

    The command 0x1C is a read command so you are not able to write a new value using that command. If you want to change the "Serial Number" parameter you should make that change in data memory. In BQStudio, if you press Window, then preferences. Then under "All Global Settings", check "Show Advanced Views". 

    Now, you can see the physical starting address for the data memory parameters. "Serial Number" is in the SBS Configuration tab in Data Memory. Using the physical starting address for Serial Number, follow the steps in this E2E post on how to edit data memory parameters using advanced comms tab. Then you can sniff the communication lines to see exactly what's happening to replicate on your system. https://e2e.ti.com/support/power-management-group/power-management/f/power-management-forum/1333721/bq28z610-bq28z610-change-utd-fail

    One thing to note is that some data memory parameters require that the gauge is unsealed to edit.

    Regards,

    Nick Richards

  • Hi Nick,

    Many thanks for your fast reply and suggestions, I will be reviewing them and seeing if I can get further forward.

    In the meantime..

    1C to me is the register location where I read out the Serial number, much as 1B is where I read out the date, but to write the date I simply use the same method I tried to use for writing the serial number, but just to register 1B

    Date write - which works    -smbw=0F,0E -slave8=17 -register=1B -pec=off -speed=100000

    Serial Number write - doesn't work -  -smbw=03,03,00,74 -slave8=17 -register=1C -pec=off -speed=100000

    Is there  difference in the way both memory locations can be accessed, the date can be written direct and the serial number needs to be written in a different location with a different method?

    Still a learning curve for me!

    Thanks,

    Steve

  • Hello Steve,

    Some commands are read only, and other commands are read and write.

    Regards,

    Nick Richards

  • Hi Nick,

    I parked this for a while, but have come back to it, just to update in case it helps anyone else, I can successfully write a serial number now using a MCP2221 interface device.

    for example this will write the serial number 1234

     -smbw=04,6E,40,34,12 -slave8=17 -register=44 -pec=off

    That serial number is in hex, so you may want to convert it.

    Many thanks for you help in this, you did point me in the right direction Slight smile

    Best wishes,

    Steve