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: DataFlash Write Issue

Part Number: BQ40Z50
Other Parts Discussed in Thread: BQSTUDIO, EV2400

Hello, my friends

   I would like to develop a Visual Basic 6 program to revise DataFlash for bq40z50, unfortunately i am not able to correctly write the dataflash address to device via WriteSMBUSBlock command 0x44,

At the first, the codes are as below: 

Text9.text="0030"   '0030 is seal command 

lerror = WriteSMBusBlock(&H44, Text9.Text, Nums)  

then the device can be sealed successfully via bqstudio check.

Secondly, my codes are as below:

Text9.text="4E08"   '4E08 is the address of Cycle Threshold in Advanced Charge Algorithm 

use the function,WriteSMBusBlock(&H44, Text9.Text, 8)   'send SMBus write block with command 0x44,block=0x08+0x4E

then read the parameter via  the function,ReadSMBusBlock(&H23, sBlockResponse) and convert data1_LowByte+data1_highByte+data2_LowByte+data2_highByte to decimal, the the value via read my codes SMBus read block was not cosistent with bqstudio SMBus read block, the "4E08" have not been write successfully.

So as to i am not able to write 0x0100 to dataflash address 0x4E08  

 'send SMBus write block with command 0x44,block=0x08+0x4E+data1_LowByte+data1_highByte+data2_LowByte+data2_highByte

Would you please give me support to fix the bug, thanks a lot.

I'm looking forward to hearing from you.

Sincerely yours

Mike

  • Hello Mike,

    Have you followed the gauge communication app note to develop your communication code?

    I'm not sure how the functions are defined, they may operate differently than our drivers for bqStudio.

    I don't believe this is a bug, I would follow the app note: www.ti.com/.../slua801.pdf

    Sincerely,

    Wyatt Keller

  • Hello Wyatt,

      I'm appreciated for your promply reply. I know it's not a bug for the gas gauge.

    Unfortunately, after going through the file, i could not find SMBus Block write example of VB codes.

     I'm using the VB example codes download from TI's website, the program's step is as following:

     a)SMBus block write.command=0x44,Data sent= 08 4E 00 01 (Advanced Charge Algorithm-Degrade Mode1 -Cycle Threshold地址+Data_lowbyte+Data highbyte)

     b)SMBus block read.command=0x23,Data read=

    95 00 5F 38 22 32 00 05 

    F3 01 50 70 44 32 00 0F 

    1F 03 3C 50 CD C8 00 19 

    01 0A A0 0C 68 10 2C 01 

    from item b, 95 00,the data 00 01 in item a have not been correctly writed to address 0x4E08 of DataFlash [use bqStudio execute a)and b),the data: 00 01

    could be correctly writed to DataFlash.

    c)SMBusblock write.command=0x44,Data sent=00 30,the device can be sealed.

    I am very cofused on this, the item c can be normally executed, i don't know what's wrong for item a, both of item a and item c, i call out

    lerror=WriteSMBusBlock(&H44, (Text9.Text), 8).    [item a:text9.text=08 4E 00 01,item c: text9.text=00 30]

    Could you please help to fix the bug for the codes, thank you.

     

    Sincerely yours

    Mike

  • Hello Mike,

    What is the link you're getting the code examples from? You can reference the TI tool chain using a logic analyzer with bqStudio and EV2400 if you want to see the waveforms for our tools.

    Are you trying to seal the gauge? We can't directly help debug code because each library/driver is different for SMBus communication.

    Sincerely,

    Wyatt Keller 

  • Hello Wyatt,

       I got the code examples from the link: https://e2e.ti.com/support/power-management/f/196/t/790078?keyMatch=EV2300%20CUSTOMER%20KIT&tisearch=Search-EN-everything. Under the link,look on Bryan's post at Apr 5, 2019 4:46 PM: 3755.EV2300-Customer-Kit - 2800  1 2900.zip

    I have no logic analyzer at my side and i'd like to seal the gauge after updating the DataFlash parameter. Could you please give me a example code for SMBus block write,

    VB code would be the best,thanks a lot.

    Sincerely yours

    Mike

  • Hello Mike,

    I don't have much experience with this code as it's for our older EV2300 module. Let me contact someone with more experience with our EV modules.

    Sincerely,

    Wyatt Keller

  • Hello Mike,

    You can do read/write blocks within bqStudio using an EV2400. What are you trying to achieve using the examples?

    Sincerely,

    Wyatt Keller

  • Hello  Wyatt,

     I can read/write block within bqStudio using EV2400.

    I'm trying to develop an automatic small program including the function unseal,update some certain dataflash values,seal and shutdown the device. Till now i am not able to update the dataflash because of the bugs of codes.Thanks a lot for your fully support.

    Sincerely yours

    Mike

  • Hi Mike,

    A more simple solution than creating a program would be to update the srec and just use that to change the parameters.

  • Hello Jessica,

      I now we can program the srec file including changed parameters using bqStudio,but it will take a relatively longer time than a rework program just change several parameters within 10EA.I was expected to develop a program including unseal,change several parameters,seal and shutdown the device.The program will take less time than bqStudio and it will be more convenient for rework operation.

     Finally,fortunately i have already fixed the bug,  parameter can be changed via program.Anyway,thanks for your support.

    Sincerely

    Mike