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.

How to reset lifetime max temp after testing via SMB Bus on BQ20Z65R1

During product Manufacturing we will not have access to  EVM software or PRO screen. We are creating a stand alone production test unit based on a hacked version of our battery charger since it incorporates a micro and SMbus capabilities to interface with the battery packs.  The main reason is to limit operator interaction with the flash file and gas gauge settings. We need to reset the lifetime max temperature prior to shipping the battery pack and were hoping to use the system flash page access to modify the lifetime temperature value.  Understanding how the PRO screen worked may have helped us figure out how to retrieve the data we needed.  

Question 1

We have similar version of the sample code for our application, but it appears not to work as indicated.   Could we get the source code for the EVM2300 to help us figure out what is missing?

Question 2 
What is the state of the battery to allow access and write with command 0x77 ?

When I use my code to read back the page using 0x73,  I receive the correct data and can read and write other sections of the chip using these same functions.

 battery_address = ADDRESS_SMART_BATTERY;                              // 0x16
 command = DATA_FLASH_SUB_CLASS_ID_CMD;                           // 0x77
 page_number = DATA_FLASH_SUB_CLASS_PAGE_1_CMD;        // 0x78
 sub_class = 0x0059;
 bytes_to_read = 32;

         // set to subclass
 temp_char = write_SMBus_int( battery_address, command, sub_class);
 Nop();                                        
         //  read subclass  ((((=== used this to verify read back of 0x0059)))))
        //  temp_int = read_SMBus_int( battery_address, command);
 Nop();                        
 Read_SMBus_String( battery_address, page_number, bytes_to_read);

Attached is a screen shot of the data received back from the above code and the correct data from 0x73

Question 2
Is there any special read/writes to allow these commands to operate.

Question 3
in sluu386.pdf  Section C.1.4 page 102


        Write is slave address 0x16  etc. same section page 103
        Write is slave address 0x17  etc
        Why the difference for almost the same thing?

screen shot good data:

Screen Shot Bad Data

  • Hi Rick,

    I have been looking at this issue.

    I believe there is a mistake in your code above is where you have sub_class = 0x0059. 

    59 is the decimal subclass value for lifetime data so you want to convert that to 3B hex ,

    I managed to get wrting to max temp via the Pro screen to works as shown here

    I had previously used the FLASH screen to change the life timemax temp to 40 C ( default is 30C ) .

    40 is represented as  0190 hex as each bit is 0.1C.

    So I wrote 003B ( ie 59) using write SMB Word 77 as my first step per c.1.4 on sluu386 page 102 section .( you can see it above) . I am ignoring the slave address entry step.

    Then I did a read SMB Block with SMB command 78 and you can see the result at offset 0 was 0190 as expected.

    So to see if I could write something else as the Max temp  I copied that complete block ( all 32 bytes - the little window does not show them all) into the the Write SMB block window, and then manually edited the 0190 to be 012C ( where 0120 should give me 30C , ie it is 300 in 0.1C bits). I set the SMB Command to write as 78 and clicked enter.  

    Then when I switched to the FLASH screen and did a 'read all' l I saw that  my life time max temp had changed from 40  to 30.

    I hope this helps.

    I am trying to discover why TRM refers to slave address 17 as well as 16, I don't have that part of the puzzle yet. The gauge is 16 as I understand.

    Mike

     

     

     

     

     

  • I am told the LSB is not used, so both 0x16 and 0x17 are the same.

    In our software we use this bit to indicate use of PEC. The general guideline is to use PEC all the time.

    Mike