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.

BQ78350R1 SMBUS Floating Point Calculation

Other Parts Discussed in Thread: BQ78350-R1, BQSTUDIO

Hello TI team,

I'm just trying to understand how the floating point values ​​for "CC GAIN" and "Capacity Gain" are calculated.
The conversion is not performed as in IEEE754.

On the bus for the value 1.0 e.g., the bytes 0x84 0x07 0x02 0x75 are sent after the addresses etc.
If I am right, then 0x84 should contain the exponent. The remaining bytes contain the sign and the mantissa:

EXP (B0) MAN (B0) MAN (B1) MAN (B2)
10000100 S0000111 00000010 01110101
                    |
                    |
                    +->SIGN

I´m not sure about this, maybe the order is wrong?!

I didn´t find any detailed information and the documentation contains some confusing mistakes.
Is the Bias = 127 and Base = 2?
How is it calculated?

Thanks in advance for your help.

Kind regards
Mathias

  • Please reference the information in this link. It may help with the Xemics F4 data conversion.

    e2e.ti.com/.../1546093
  • Dear Mr. Cosby,

    thank you for your answer. I had a look to the SLUAxxx from Mr. Ming Yu and it didn´t help that much. The problem is, that the value in the example (10.124) results on my BQ78350-R1 with BQ-Studio in 0x80555E9E. It is not 0x7F71205C like in the example and what I would have expected. So the calculation seems to be different.

    I´m looking forward for another solution.

    Kind regards
    Mathias
  • Mathias

    I was able to follow the steps in the document to convert the number. Here are the steps that I took.

    0x80555E9E

    Take the first byte, 80, as the exponent.

    • Convert to decimal. 80H -> 128 decimal
    • Find the exponent. 128 - 128 - 24 = -24 -> 2^-24

    Convert the mantissa.

    • 55 5E 9E -> D5 5E 9E
    • Convert to decimal.  D55E9EH -> 13983390

    Calculate the number

    • 13983390 x 2^-24 = 0.8335

    There is a conversion factor in bqStudio that is not documented very well.

    • Data entered in the bqStudio field = 8.4381 / data flash value = 8.4381 / 0.8335 = 10.1240

    The conversion factor for the Capacity Gain is 2517328.05 / data flash value.

    I hope that this helps.

    Tom

  • Hello Mr. Cosby,

    thank you very much. The advice about the magic factors was great. It is written as default valuein the datasheet SLUUBD3B in Table 19-1 but I never expected this as a factor that is needed for calculation.

    Kind regards

    Mathias