Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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: 0x44 ManufacturerBlockAccess() versus Read Block

Other Parts Discussed in Thread: BQ40Z50, BQ78350

To access the SafetyAlert data, I can use the 0x44 ManufacturerBlockAccess():

0x16 0x44 0x02 0x50 0x00 0x60, then 0x16 0x44 0x17 0x06 0x50 0x00 0x00 0x00 0x00 0x00 0x76

Or Read Block seems to work also:

0x16 0x50 0x17 0x04 0x00 0x00 0x00 0x00 0x05

Is the difference between these two methods that the Read Block for SafetyAlert is not available when Sealed? (And that the Read Block reads RAM, while the ManufacturerBlockAccess() reads Data Flash?)

Thanks.

Tom

  • I would also like to know the answer to this question since I'm dealing with this now also needing to access SafetyAlert Data after the fuel gauge has been sealed.
  • Hey Tom I'm also working on getting code written to pull data from the fuel gauge once it has been Sealed.

    I see you have the ManufacturerBlockAccess(): code working correctly so you get the following return:

    0x16 0x44 0x02 0x50 0x00 0x60, then 0x16 0x44 0x17 0x06 0x50 0x00 0x00 0x00 0x00 0x00 0x76

    I'm getting the first part right but the last part of the transaction is not coming back the same as yours.

    Is the code that your using Arduino based? Anyway you could share that ManufacturerBlockAccess(): code that is working for you?

    Here is the LA read from my code:

    Here is the function that is trying to pull the code:

    int BQ20Z45::readStringB(uint8_t address, char* result, int len)
    {
    int pos = 0;
    int newlen;

    // Initiate a manufacturer_block_Read
    Wire.beginTransmission(BQ20Z45_Address);
    Wire.write(0x44);
    Wire.write(0x02);
    Wire.write(0x50);
    Wire.write(0x00);
    Wire.endTransmission(false);

    newlen = Wire.requestFrom(BQ20Z45_Address, len + 1,true);

    if (newlen > 0)
    {
    newlen--;
    Wire.read();
    for (pos = 0; pos < newlen; pos++)
    result[pos] = Wire.read();
    }
    result[pos] = '\0'; // append the zero terminator

    return newlen;
    }

  • I do not support the Arduino product, but access to the SafetyAlert register is restricted through SMBus commands when the the device is sealed. You can access it through MAC commands. You mentioned that your results differ from Tom's. Can you post the difference and maybe I can help.
  • Thanks for replying TomCosby!

    So we have built code that successful reads data from the fuel gauge when its in the Unsealed State using read word and read block functions.

    I sealed the fuel gauge and then realized I could not longer pull info from the restricted registers via the SMBus commands so I now have to do it via the MAC Commands. So we altered the code to meet the SMBus Block Write Read protocol 5.5.8 written in the SMBus spec manual but we are not having success using the MAC commands for some reason and that's why I'm here for help.

    So I was searching old post on this forum to see if anybody else has this figured out and I came across this post where Tom says the following:

    To access the SafetyAlert data, I can use the 0x44 ManufacturerBlockAccess():

    He then post the Logic Analyzer sequence logs for the 2 steps it takes to get the data returned. 

    0x16 0x44 0x02 0x50 0x00 0x60, and then the return 0x16 0x44 0x17 0x06 0x50 0x00 0x00 0x00 0x00 0x00 0x76

    The Green Colored Bytes I'm assuming are PEC returns. Can you confirm this for me? 

     

    I have the HPE bit set to 0 , I'm using the BQ78350 fuel gauge not the BQ40z50 as Tom is but their communication specs between the 2 look basically identical. 

    Here what the BQ78350 TRM has to say about the PEC feature:

    So we have written code for my micro controller attempting to use the 0x44 ManufacturerBlockAccess(): 0x44 Block Write then Read command,  just like Tom did successfully above. Toms code communication is shown below in RED and Green. 

    Write = 0x16 0x44 0x02 0x50 0x00 0x60, and then the READ =  0x16 0x44 0x17 0x06 0x50 0x00 0x00 0x00 0x00 0x00 0x76

    Now lets look at the code we wrote trying to read this same 0x0050 SafetyAlert Register ManufacturerBlockAccess. I'm posting this just incase it helps trouble shoot. 

    int BQ20Z45::readStringB(uint8_t address, char* result, int len)
    {
    int pos = 0;
    int newlen;
    
    // Initiate a manufacturer_block_Read
    Wire.beginTransmission(BQ20Z45_Address);
    Wire.write(0x44);
    Wire.write(0x02);
    Wire.write(0x50);
    Wire.write(0x00);
    Wire.endTransmission(false);
    
    newlen = Wire.requestFrom(BQ20Z45_Address, len + 1,true);
    
    if (newlen > 0)
    {
    newlen--;
    Wire.read();
    for (pos = 0; pos < newlen; pos++)
    result[pos] = Wire.read();
    }
    result[pos] = '\0'; // append the zero terminator
    
    return newlen;
    }
    

    Now when we run the code above it looks like this on the Logic Analyzer:

     So lets look at the difference is between Toms communication log and mine. 

    Toms code again: Write = 0x16 0x44 0x02 0x50 0x00 0x60, and then the READ =  0x16 0x44 0x17 0x06 0x50 0x00 0x00 0x00 0x00 0x00 0x76

    My code =               Write = 0x16 0x44 0x02 0x50 0x00            and then the READ = 0x16 0x17 0x17 0x17 0x17 0x17

    Can you confirm what the 0x60 is in Toms code? Is it a PEC return from the Fuel gauge? 

    If it is PEC then is the reason I'm getting that response back from the Fuel Gauge because I have the HPE bit set to 0? 

    Take a look and let me know what you think is going on. 

    Thank you very much for helping. I just need to figure out this last part to move forward with the this fuel gauge. 

  • We're not using Arduino. We'll be using a Freescale i.MX 6 (single or dual core) processor that talks to an FPGA over PCIe, connected to the bq40z50. It's a medical product that requires a lot of horsepower to handle a complicated UI and a LOT of data calculations for patient results. The FPGA will handle critical timing, especially needed during the sampling phases, and most of the "simpler" I/O interfacing.

    I was using TI's Battery Management Studio software, and its Advanced Comm SMB window to gather that data. No code has been written yet. But I can verify that the last bytes in the data are PEC's.

    Hope this helps!
  • Thanks for getting back with me Tom. 

    Tom Cosby, can I access the 0x44 0x02 0x50 0x00 from this part of the BQ Software? 

    I tried adding 44 to the target address and then read from address 50 but there was a communication error. 

    Can access the Manufacturer_Block_Read function from within the BQ software for the BQ78350? If so how do I do it so I can confirm whats going on with the logic analyzer. 

  • You should be able to get the data by writing and reading from 44. Write first to identify the command and then read 44.

  • Thanks Thomas Cosby!

    I'm now able to see the correct communication process. I should be able to figure this out now.