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.

bq20z95: Flash read problem

Part Number: bq20z95

I have to read the whole GG flash from my test program, and it works for the most part, except for reading the Calibration class, Data subclass 104. 

I can read the subclass/page in my C code, but when I try to parse into subclass parameters, I get mostly garbage:

The raw data from my 33 byte read from subclass 104 is 0x 15 81 6E D9 06 94 07 E0 BA 5F 82 05 08 56 22 F8 00 00 74 27 FA 00 B1 B1 B1 B1 B1 B1 B1 B1 B1 B1 B1 00. 

(I always read 1+32 bytes at a time when I read the data flash, but that should not affect the data.  my buffer is big enough to keep the data.).

I wonder if the information in the "bq20z90-V1.50 + bq29330, bq20z95 Technical Reference" (pages 194, 210) is incomplete/inaccurate? 

The rest of the data flash comes out OK.

Thank you.

  • Hi Marius

    Pls see attached.

    8838.how EVSW Display the calibration Raw Data V1.03 (1).pdf

    Also, see attached app note below

    http://www.ti.com/lit/an/slva148a/slva148a.pdf

    Hope this helps.

    thanks

    Onyx

  • Onyx,

    Thank you for the info, but I was still not able to convert the data properly. Looking into the second reference, I found that the float is Xemics format. I found some C code online to do the conversion, but my result came to 1.865998, not 5.048.

    Even if the code I found is wrong, I believe there's something else that 's not documented in the Tech Reference: The CC Gain and CC Delta extracted with the bqEVSW are the same value, but if you look at the raw data I extracted from flash, you will see that bytes 1-4 (byte 0 is skipped, it's the size of the data) and bytes 5-8 are different. They cannot convert to the same number (5.048) as reported by the bqEVSW.

    I'd like to know how is the bqEVSW processing the block of flash to obtain the following:
    [Data(Calibration)]
    CC Gain = 5.048
    CC Delta = 5.048
    Ref Voltage = 1222.50
    AFE Pack Gain = 672.91
    CC Offset = -0.301
    Board Offset = 17.1
    Int Temp Offset = 3.9
    Ext1 Temp Offset = -.6
    Ext2 Temp Offset = 0.0

    Here's my raw data again:
    [Data(Calibration)]: dataBuffer = 0x 15 81 6E D9 06 94 07 E0 BA 5F 82 05 08 56 22 F8 00 00 74 27 FA 00 B1 B1 B1 B1 B1 B1 B1 B1 B1 B1 B1 00 (I read 34 bytes, only the first 21 are used)

    Thank you
  • Hi Marius,

    Please apply the offsets as shown in Table C-262 in the TRM ( www.ti.com/.../sluu264a.pdf ), instead of the reading the data sequentially.

    Please let me know if this resolves your issue.

    Sincerely,
    Bryan Kahler
  • I'm not sure I follow. I read the Calibration Class, Data Subclass (104) as outlined in Table C-262. You can see the data in my previous post. However, when I parse the data I get mostly garbage. And btw, I do the same thing for the rest of the flash, one subclass at a time, and I have no problem parsing and converting the data for each parameter as shown in table C-262. The only subclass I have problems with is the Calibration Data.
  • Hi Ghita,

    Please use the calculation method provided in this file:

    e2e.ti.com/.../how-EVSW-Display-the-calibration-Raw-Data-V1.03-_2800_1_2900_.pdf

    But with these scaling values:

    CC Gain: 9.419/x
    CC Delta: 2809326/x
    Ref Voltage: x*5
    AFE Pack Gain: (x*3125)/1024
    CC Offset: (x*9.419)/64000
    Board Offset: (x*9.419)/64
    Int Temp Offset: x
    Ext1 Temp Offset: x
    Ext2 Temp Offset: x

    Sincerely,
    Bryan Kahler
  • This is much better.  but still not all there:

     CC Gain = 5.047701

     CC Delta = 5.047700

     Ref Voltage = 122250.00

     AFE Pack Gain = 67291.26

     CC Offset = -0.301

     Board Offset = 17.1

     Int Temp Offset = 39.0

     Ext1 Temp Offset = 250.0

     Ext2 Temp Offset = 0.0

    and was expecting:

      CC Gain = 5.048

      CC Delta = 5.048

      Ref Voltage = 1222.50

      AFE Pack Gain = 672.91

      CC Offset = -0.301

      Board Offset = 17.1

      Int Temp Offset = 3.9

      Ext1 Temp Offset = -.6

      Ext2 Temp Offset = 0.0

    Looks like some scaling factors are not quite there or missing.