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.

BQ27541 changes to be made for bigger battery

Other Parts Discussed in Thread: BQ27541, BQSTUDIO, EV2400

Team,

My customer would like some guidance on:

Our project is using the bq27541 to monitor an 8700mAh battery, and our customer would like to upgrade to a 10Ah battery.  I believe this requires updating the parameter string sent to the fuel gauge?

Can you please help how to get started with this change?


Thanks

Viktorija

  • Moving to another battery likely requires additional changes to the gauge configuration (if the chemistry of the battery is different).

    At the very least, you'll have to update the Design Capacity parameter. This is stored in data memory, subclass "Data", offset 23 as a 16 bit integer. Unit is mAh.

    You can generate a flash stream file for the gauge with bqStudio after adjusting these two parameters in the data memory view followed by golden image flash stream export.

    BQ27541 changes to be made for bigger battery

  • Hi, my name is Justin, I work for the end customer (Coverttrack) that needs to change to a new higher capacity battery. I'm not sure where in the process TI is in resolving this issue, but wanted to give more background and info that may help.

    The source code for our GPS tracking device was written by 3rd party engineering firm (Twisthink). From what I gather, one of TI's engineers (Jared Casey) provided Twisthink a long array string of ASCII chars that is loaded into the flash to configure all the parameters. I just need to know how that array was created so I can plug in the new capacity values. Will the bqStudio output this string or was it custom created by one of your engineers? If it is a custom creation then bqStudio may not be helpfull.

    The array( fuelGaugeParams[ ] ) is delimited with multiple chars (W, C, X), the code looks for each of these chars in the string to determine whether to Write (W), Compare (C), or Wait (X). There are over 4000 chars in the string, so trying to parse and understand it is daunting. Please see the attached file with the code written by TI that initializes the FG.

    Thanks!

    /* FuelGauge.c */
    
    const char fuelGaugeParams[FUEL_GAUGE_PARAMS_MAX] =   {"W:AA000100C:AA004105W:AA000200C:AA002402W:AA001404W:AA007236W:AA00FFFFW:AA00FFFFX:1000W:AA00000FX:1000W:160003W:16010000W:16640300X:20C:166600W:160002W:16010000W:1604EAFF3334FA33B5FA3330FF33E5FD33FFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3F24023F58CB33CB0008000000000000FFAA0EFBA70EFFA60EFFA10EFFA00EFEA30E4BA20ED2FF3AFFA10E5BA00EFFA30EW:16649635X:2C:166600W:160002W:16010100W:16045AA20EBDA50E04A40ECAFF3AFEA10E4BA00EFEA30E4BA20ECAFF3AC2FF3AD6FF33FFAF0E014F033F110CCDFF30D4FF352F100CD4FF35FFFF2301AF14014F033F110CC5FF30CCFF352F100CCCFF35FFFF23FFDF0BC4FF33B4F639FEAF16E5FF00W:1664AB2EX:2C:166600W:160005W:16640500X:170C:160483FA729EW:16000CW:160483DEW:16646D01X:200C:166600W:16000AW:16010000W:16047E66376D9302F7B0FA9DFFFF00060BB810680BA403E8002003E8002000201096W:16642F0CX:2C:166600W:16000AW:16010100W:16040051F6C9F414520921326D00000000CFDC17F30000167A00000000D07E17DF00W:1664C709X:2C:166600W:16000AW:16010200W:16040017F300003A36FD910025300100EF0511050100001001003C00503C00643C00W:1664EE05X:2C:166600W:16000AW:16010300W:160420254F000006106CFF9CFEE8000102BC001403E8010002BC012C001E00C8C814W:16641009X:2C:166600W:16000AW:16010400W:160408003C0E10000A46050F050F0A0320006446500A0E530E530190006419DC5C60W:16648105X:2C:166600W:16000AW:16010500W:160400C800040332000100140001001403230708255A0F1E600AF000C82801F40000W:16645A05X:2C:166600W:16000AW:16010600W:1604000000000000000043800400C800000114002B05000A138800C80A0028023210W:1664C703X:2C:166600W:16000AW:16010700W:160463103A100E0FF50FDD0FC10FA20F870F690F540F3E0F290F150F000EEB0ED20EW:16645D08X:2C:166600W:16000AW:16010800W:1604BB0E9A0E7C0E650E4D0E370E260E170E0A0DFC0DEE0DE20DD70DC80DB50D9E0DW:1664A909X:2C:166600W:16000AW:16010900W:16047E0D630D370D0A0CF60CE80CBF0B77FBE0FC4EFE57FE5BFDDCFC87FCD7FC56FDW:1664F011X:2C:166600W:16000AW:16010A00W:160465FCB3FC8BFC97FC1FFB8CFB0FFB3DFA6BFC53FC3CFC42FCAFFD2EFE91FEA7FEW:16645816X:2C:166600W:16000AW:16010B00W:1604C7FED5FF0BFE04FB88F98FF782F6C9F747F6D0FA02FE170029FF97FDF0FD06FFW:1664C115X:2C:166600W:16000AW:16010C00W:1604B7FF9BFF8AFF82FFA1FF93FFB4FF7CFF8DFF87FF1BFF21FEF5FED0FEE37D007DW:1664B917X:2C:166600W:16000AW:16010D00W:1604007D007D007D007D007D007D007D007D007D007D007D007D007D00000001C200W:16643307X:2C:166600W:16000AW:16010E00W:1604321068FFCE022600B40019006428635FFF6200321176A71803001404000AF000W:1664C008X:2C:166600W:16000AW:16010F00W:16040A05003201C21414000809F600003C004B0028003C3C01019036720414FFFFFFW:1664C207X:2C:166600W:16000AW:16011000W:1604FF0123456789ABCDEFFEDCBA9876543210013300D714940ABD07C6F71300000AW:16646C0DX:2C:166600W:16000AW:16011100W:16041964003C00000000000000000000000000000000000000000000000000000000W:1664D400X:2C:166600W:16000AW:16011200W:1604000000000000000000000000000000000002260201F402580202260E00000000W:1664CD01X:2C:166600W:16000AW:16011300W:1604000000000000000000009E484ED87D0A006401B0000A0E10FFFD440031002100W:16647F06X:2C:166600W:16000AW:16011400W:160401000320B25A6424540D71FD445078786E0A321E000A2D37000A7F070A0A4251W:16649607X:2C:166600W:16000AW:16011500W:160432373534582D4731009600AF004B00643209C4020A2811940211300000000000W:1664FD05X:2C:166600W:16000AW:16011600W:16040000000000000000000000000000000000000000000000000000000000000000W:16642000X:2C:166600W:16000AW:16011700W:160400000000000000000000000000000000000000000000000000000000FFFFFFFFW:16641D04X:2C:166600W:16000AW:16011800W:1604005500BD006B0073007C007E006B006F007400720079008200A000E4016603BCW:16647108X:2C:166600W:16000AW:16011900W:1604FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640320X:2C:166600W:16000AW:16011A00W:1604FFFF00BD006B0073007C007E006B006F007400720079008200A000E4016603BCW:16641C0AX:2C:166600W:16000AW:16011B00W:1604FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640520X:2C:166600W:16000AW:16011C00W:1604000000000000000000000000000000000002260201F402580202260E00000000W:1664D701X:2C:166600W:16000AW:16011D00W:1604000000000000000000009E484ED87D0A006401B0000A0E10FFFD440031002100W:16648906X:2C:166600W:16000AW:16011E00W:1604FFFFFFFF0000017FFFFFFE7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640B1CX:2C:166600W:16000AW:16011F00W:1604FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640920X:2C:166600W:160008W:16640800X:2C:1604486FW:160005W:16640500X:170C:160483FA729EW:160001W:16010000W:160305W:1604545415W:1664C300X:2C:166600W:160005W:16640500X:170C:1604D84E489EW:16000FW:16640F00X:4000:"};
    
    const U8 subClass[NUM_SUBCLASSES_TO_WRITE]= { SAFETY_SC, CHARGE_TERM_SC, DATA_SC, INTEG_DATA_SC, IT_CFG_SC,
       STATE_SC, OCV_TABLE_SC, RA0_SC, RA0X_SC, CALIB_DATA_SC, DES_ENERGY_SCALE_SC, REGISTERS_SC};
    
    void FuelGaugeTask( void )
    {
       static OStypeMsgP msgP;
       static fgMsg_t *fgMsgP;
       static U8 rawFGData[MAX_FG_WRITE];
       static U8 data2Compare[6];
       static U16 temp16;
       static U8 i;
    //   static U8 dataFlashBlock;
       static U16 fuelGaugeParamsIndex;
       static char hexByteStr[5];
       static U8 i2cAddr, memAddr;
       static BOOL compareFlag;
       static BOOL failFlag;
    
       OS_Delay(OS_5SEC);
    
       for(;;)
       {
          OS_WaitMsg( MSG_FUEL_GAUGE, &msgP, OSNO_TIMEOUT );
          fgMsgP = (fgMsg_t*)msgP;
    
          switch(fgMsgP->cmdType)
          {
             case FUEL_GAUGE_INIT:
                 failFlag = FALSE;
    
                 dprint(DPRINT_FUELGAUGE, "<FG> Initlzng.");
                 rawFGData[0] = CTRLDATA_FWVersion; // LSB
                 rawFGData[1] = 0x00;               // MSB
                 WriteFgCmd( CMD_Control, rawFGData, 2, BINSEM_FG );
                 OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                 ReadFgCmd( CMD_Control, rawFGData, 2, BINSEM_FG );
                 OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                 dprint(DPRINT_FUELGAUGE,"<FG> Firmware Rev: [%02X%02X]", rawFGData[1], rawFGData[0]);
                 if(rawFGData[1] != 0x02 && rawFGData[2] != 0x24)
                 {
                    dprint(DPRINT_FUELGAUGE,"<FG> Bad FG Rev. It shld be 2.24!");
                    OS_Delay(OS_20MSEC);
                    //Reset();
                 }
    
                 rawFGData[0] = CTRLDATA_HWVersion; // LSB
                 rawFGData[1] = 0x00;               // MSB
                 WriteFgCmd( CMD_Control, rawFGData, 2, BINSEM_FG );
                 OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                 ReadFgCmd( CMD_Control, rawFGData, 2, BINSEM_FG );
                 OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                 dprint(DPRINT_FUELGAUGE,"<FG> Hardware Rev: [%02X%02X]", rawFGData[1], rawFGData[0]);
                 rawFGData[0] = CTRLDATA_DeviceType; // LSB
                 rawFGData[1] = 0x00;                // MSB
                 WriteFgCmd( CMD_Control, rawFGData, 2, BINSEM_FG );
                 OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                 ReadFgCmd( CMD_Control, rawFGData, 2, BINSEM_FG );
                 OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                 dprint(DPRINT_FUELGAUGE,"<FG> Device Type: [%02X%02X]", rawFGData[1], rawFGData[0]);
                 if((rawFGData[0] != 0x41) || (rawFGData[1] != 0x05))
                 {
                 	dprint(DPRINT_FUELGAUGE,"<FG> ERR: Unxpctd Dev Type.  Shld be [5041]");
                 }
    
                 fuelGaugeParamsIndex = 0;
                 do
                 {
                    compareFlag = FALSE;
                    switch( fuelGaugeParams[fuelGaugeParamsIndex] )
                    {
                       case 'C':                          //Compare
                          compareFlag = TRUE;
                       case 'W':                          //Write
                          fuelGaugeParamsIndex += 2;      //moved to first byte.
                          memset(hexByteStr, 0x00, 5);    //clear out so last byte is null.
                          memcpy(hexByteStr, &fuelGaugeParams[fuelGaugeParamsIndex], 2);
                          i2cAddr = strtol(hexByteStr, NULL, 16);
    
                          fuelGaugeParamsIndex += 2;      //moved to address byte.
                          memcpy(hexByteStr, &fuelGaugeParams[fuelGaugeParamsIndex], 2);
                          memAddr = strtol(hexByteStr, NULL, 16);
    
                          i = 0;
                          fuelGaugeParamsIndex += 2;      //moved to first data byte.
                          do
                          {
                             memcpy(hexByteStr, &fuelGaugeParams[fuelGaugeParamsIndex], 2);
                             rawFGData[i] = strtol(hexByteStr, NULL, 16);
                             i++;
                             fuelGaugeParamsIndex += 2;      //moved to next data byte.
                          } while(fuelGaugeParams[fuelGaugeParamsIndex+1] != ':');
    
                          if(compareFlag == TRUE)
                          {
                             i2cRead( i2cAddr, memAddr, data2Compare, i, BINSEM_FG );
                             OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                             if( memcmp(data2Compare, rawFGData, i) != 0)
                             {
                                dprint(DPRINT_FUELGAUGE,"<FG>Cmpr Fail at 0x%X", memAddr);
                                failFlag = TRUE;
                             }
                          }
                          else
                          {
                             i2cWrite( i2cAddr, memAddr, rawFGData, i, BINSEM_FG );
                             OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                          }
                          break;
    
                       case 'X':                          //Wait
                          fuelGaugeParamsIndex += 2;      //moved to first byte.
                          memset(hexByteStr, 0x00, 5);    //clear out so last byte is null for string use.
                          //wait time is a variable length string
                          i = 0;
                          do
                          {
                             hexByteStr[i] = fuelGaugeParams[fuelGaugeParamsIndex];
                             fuelGaugeParamsIndex++;
                             i++;
                          } while(fuelGaugeParams[fuelGaugeParamsIndex+1] != ':');
                          temp16 = atoi(hexByteStr);
    
                          OS_Delay(temp16);
                          break;
    
                       default:
                          fuelGaugeParamsIndex++;
                          break;
    
                    }
                 } while (fuelGaugeParamsIndex < FUEL_GAUGE_PARAMS_MAX);
    
                 if(failFlag == TRUE)
                    Reset();
    
                 rawFGData[0] = 0x00;
                 rawFGData[1] = 0x00;
                 WriteFgCmd( CMD_BlockDataControl, rawFGData, 1, BINSEM_FG );
                 OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                 OS_Delay(OS_10MSEC);       //give flash time to be written.
    
                 rawFGData[0] =
                 rawFGData[1] = 0x00;          // start at first byte.
                 WriteFgCmd( CMD_DataFlashClass, rawFGData, 1, BINSEM_FG );
                 OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                 OS_Delay(OS_10MSEC);
    
                 rawFGData[0] = 0x00;
                 rawFGData[1] = 0x00;          // start at first byte.
                 WriteFgCmd( CMD_DataFlashBlock, rawFGData, 1, BINSEM_FG );
                 OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                 OS_Delay(OS_10MSEC);       //give flash time to be written.
    
                 //Read out the Data SubClass Data Block
                 ReadFgCmd( CMD_BlockData, rawFGData, SIZE_OF_BLOCK_DATA, BINSEM_FG );
                 OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                 OS_Delay(OS_10MSEC);
    
                 rawFGData[PACK_CONFIG_OS] = (U8)PACK_CONFIG_DF;
                 rawFGData[PACK_CONFIG_OS+1] = (U8)(PACK_CONFIG_DF >> 8);
                 //Write the Data SubClass Data Block back into memory.
                 WriteFgCmd( CMD_BlockData, rawFGData, SIZE_OF_BLOCK_DATA, BINSEM_FG );
                 OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                 OS_Delay(OS_10MSEC);       //give flash time to be written.
    
                 temp16 = calcBlockCs(rawFGData);
                 rawFGData[0] = (U8)temp16;
                 rawFGData[1] = 0x00;
                 WriteFgCmd( CMD_BlockDataCheckSum, rawFGData, 1, BINSEM_FG );
                 OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                 OS_Delay(OS_200MSEC);       //give flash time to be written.
                 
    
    
                 break;
    
             case SET_GAIN:
                //Set BlockDataControl
                rawFGData[0] = 0x00;
                rawFGData[1] = 0x00;
                WriteFgCmd( CMD_BlockDataControl, rawFGData, 1, BINSEM_FG );
                OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                OS_Delay(OS_10MSEC);       //give flash time to be written.
    
                rawFGData[0] = CALIB_DATA_SC;
                rawFGData[1] = 0x00;          // start at first byte.
                WriteFgCmd( CMD_DataFlashClass, rawFGData, 1, BINSEM_FG );
                OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                OS_Delay(OS_10MSEC);
    
                //set the data flash block
                rawFGData[0] = 0x00;
                rawFGData[1] = 0x00;          // start at first byte.
                WriteFgCmd( CMD_DataFlashBlock, rawFGData, 1, BINSEM_FG );
                OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                OS_Delay(OS_10MSEC);       //give flash time to be written.
    
                //Read out the Data SubClass Data Block
                ReadFgCmd( CMD_BlockData, rawFGData, SIZE_OF_BLOCK_DATA, BINSEM_FG );
                OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                OS_Delay(OS_10MSEC);
    
                rawFGData[CC_GAIN_OS] = (U8)(CC_GAIN_DF >> 24);
                rawFGData[CC_GAIN_OS+1] = (U8)(CC_GAIN_DF >> 16);
                rawFGData[CC_GAIN_OS+2] = (U8)(CC_GAIN_DF >> 8);
                rawFGData[CC_GAIN_OS+3] = (U8)CC_GAIN_DF;
    
                rawFGData[CC_DELTA_OS] = (U8)(CC_DELTA_DF >> 24);
                rawFGData[CC_DELTA_OS+1] = (U8)(CC_DELTA_DF >> 16);
                rawFGData[CC_DELTA_OS+2] = (U8)(CC_DELTA_DF >> 8);
                rawFGData[CC_DELTA_OS+3] = (U8)CC_DELTA_DF;
    
                rawFGData[CC_OFFSET_OS] = (CC_OFFSET_DF >> 8);
                rawFGData[CC_OFFSET_OS+1] = (U8)CC_OFFSET_DF;
                rawFGData[BOARD_OFFSET_OS] = BOARD_OFFSET_DF;
                rawFGData[INT_TEMP_OFFSET_OS] = INT_TEMP_OFFSET_DF;
                rawFGData[EXT_TEMP_OFFSET_OS] = EXT_TEMP_OFFSET_DF;
                rawFGData[PACK_V_OFFSET_OS] = PACK_V_OFFSET_DF;
    
                //Write the Data SubClass Data Block back into memory.
                WriteFgCmd( CMD_BlockData, rawFGData, SIZE_OF_BLOCK_DATA, BINSEM_FG );
                OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                OS_Delay(OS_10MSEC);       //give flash time to be written.
    
                temp16 = calcBlockCs(rawFGData);
                rawFGData[0] = (U8)temp16;
                rawFGData[1] = 0x00;
                WriteFgCmd( CMD_BlockDataCheckSum, rawFGData, 1, BINSEM_FG );
                OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                OS_Delay(OS_200MSEC);       //give flash time to be written.
                break;
    
             case GET_TEMPERATURE:
    
                ReadFgCmd( CMD_Temperature, rawFGData, 2, BINSEM_FG );
                OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
    
                *(fgMsgP->ptr2Data) = ConvertTemperatureToF(rawFGData[0] + 256*rawFGData[1]);
    
                dprint(DPRINT_FUELGAUGE,"<FG>Batt Temp=%dF", *fgMsgP->ptr2Data);
    
                break;
    
             case GET_BATT_LIFE_LEFT:
    
                ReadFgCmd( CMD_StateOfCharge, rawFGData, 1, BINSEM_FG );
                OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
    
                *(fgMsgP->ptr2Data) = rawFGData[0];
                dprint(DPRINT_FUELGAUGE,"<FG>Batt Life =%d", *fgMsgP->ptr2Data);
    
                break;
    
             case GET_BATT_VOLTAGE:
    
                ReadFgCmd(CMD_Voltage, rawFGData, 2, BINSEM_FG );
                OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
    
                *(fgMsgP->floatPtr) = (float)((rawFGData[0] + 256*rawFGData[1])/1000.0);
    
                dprint(DPRINT_FUELGAUGE,"<FG> Batt volt = %f V", (float)(*(fgMsgP->floatPtr)));
                break;
    
             case GET_BATT_CURRENT:
                ReadFgCmd(CMD_AverageCurrent, rawFGData, 2, BINSEM_FG );
                OS_WaitBinSem(BINSEM_FG, OSNO_TIMEOUT);
                *(fgMsgP->floatPtr) = (float)(rawFGData[0] + 256*rawFGData[1]);
    
                dprint(DPRINT_FUELGAUGE,"<FG>Batt I=%dmA (neg value = discharge)", (int)*(fgMsgP->floatPtr));
    
                break;
    
    
        }
    
        if ( fgMsgP->signalBinSem != NULL )
        {
           OSSignalBinSem( fgMsgP->signalBinSem );
        }
    
      }
    }
    
     #else
      #error Must define either FUEL_GAUGE_MAXIM or FULE_GAUGE_TI
     #endif
    #endif
    
    

  • Hi Viktorija,

    Just checking in to see what the progress is on this issue? 

    Any updates? 

    Thanks

  • Justin,

    bqStudio produces a FlashStream (.df.fs) file with this information. However, you c code has all comments, new line and space characters removed from this FlashStream file.

    So in order to update your configuration, change the parameters with bqStudio, export the golden image (which produces the FlashStream file), strip all comments, new line and space characters from this file and copy it into your constant string in your c file.

    Regards,
    Dominik. 

    For example .df.fs file for bq27541 as generated by bqStudio:

    ;--------------------------------------------------------
    ;Verify Existing Firmware Version
    ;--------------------------------------------------------
    W: AA 00 01 00
    C: AA 00 41 05
    W: AA 00 02 00
    C: AA 00 24 02
    ...

    becomes:

    W:AA000100C:AA004105W:AA000200C:AA002402

    which matches the beginning of your string from your file:

    const char fuelGaugeParams[FUEL_GAUGE_PARAMS_MAX] =   {"W:AA000100C:AA004105W:AA000200C:AA002402...

  • Thanks for this information. We're getting closer.

    In order to use bqStudio do we have to have an evaluation board connected? If we do not have one of the EV boards can we still output the .df.fs file?

  • Justin,

    You need to have a gauge connected with an EV2x00 or a TI gauge GDK. It doesn't have to be an EVM - if your hardware has the I2C signals available and the voltage levels are compatible with the I2C - PC interface then you can also use the gauge from your design. Otherwise you'll have to use an EVM. bqStudio cannot create the FlashStream file without an EVM.

    Regards,
    Dominik.

  • Hi Dominik,

    I'm going to try to connect to our PCBs I2C bus directly (without using the EV board). In order to do so can I use a USB-I2C adapter cable? Do I have to set up bqStudio to find the right com port where the cable is connected or will it find it automatically?

    Thanks

  • bqStudio only works with the EV2400 and EV2300 USB-I2C interfaces. It will not work with a generic USB-I2C adapter. You don't have to configure anything in bqStudio - it will automatically find and use the EV2x00 if it's connected to the PC and a gauge.

  • Hi,
    I ordered the EV2300 and have connected to our FG successfully on our PCB. I'm having a bit of trouble still.

    If I take one of our existing product that has the FG already programmed and configured (using a flash stream previously generated by bqStudio), read all the parameters using bqStudio, then immediately output the golden image. Would you expect the flash stream to be identical as the previous one written to it?

    What I get out after generating the golden image (.df.fs) is not the same string of data that it was programmed with (see attached file with comparison).

    The problem is, if I then take the new flash stream and remove all the comments and spaces and put it into our array, then try to reprogram the FG, it fails.

    Is this a common method other customers use? If so, does the algorithm to write the stream of data by the microcontroller come from TI?

    OLD Flash Stream
    W:AA000100C:AA004105W:AA000200C:AA002402W:AA001404W:AA007236W:AA00FFFFW:AA00FFFFX:1000W:AA00000FX:1000W:160003W:16010000W:16640300X:20C:166600W:160002W:16010000W:1604EAFF3334FA33B5FA3330FF33E5FD33FFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3F24023F58CB33CB0008000000000000FFAA0EFBA70EFFA60EFFA10EFFA00EFEA30E4BA20ED2FF3AFFA10E5BA00EFFA30EW:16649635X:2C:166600W:160002W:16010100W:16045AA20EBDA50E04A40ECAFF3AFEA10E4BA00EFEA30E4BA20ECAFF3AC2FF3AD6FF33FFAF0E014F033F110CCDFF30D4FF352F100CD4FF35FFFF2301AF14014F033F110CC5FF30CCFF352F100CCCFF35FFFF23FFDF0BC4FF33B4F639FEAF16E5FF00W:1664AB2EX:2C:166600W:160005W:16640500X:170C:160483FA729EW:16000CW:160483DEW:16646D01X:200C:166600W:16000AW:16010000W:16047E66376D9302F7B0FA9DFFFF00060BB810680BA403E8002003E8002000201096W:16642F0CX:2C:166600W:16000AW:16010100W:16040051F6C9F414520921326D00000000CFDC17F30000167A00000000D07E17DF00W:1664C709X:2C:166600W:16000AW:16010200W:16040017F300003A36FD910025300100EF0511050100001001003C00503C00643C00W:1664EE05X:2C:166600W:16000AW:16010300W:160420254F000006106CFF9CFEE8000102BC001403E8010002BC012C001E00C8C814W:16641009X:2C:166600W:16000AW:16010400W:160408003C0E10000A46050F050F0A0320006446500A0E530E530190006419DC5C60W:16648105X:2C:166600W:16000AW:16010500W:160400C800040332000100140001001403230708255A0F1E600AF000C82801F40000W:16645A05X:2C:166600W:16000AW:16010600W:1604000000000000000043800400C800000114002B05000A138800C80A0028023210W:1664C703X:2C:166600W:16000AW:16010700W:160463103A100E0FF50FDD0FC10FA20F870F690F540F3E0F290F150F000EEB0ED20EW:16645D08X:2C:166600W:16000AW:16010800W:1604BB0E9A0E7C0E650E4D0E370E260E170E0A0DFC0DEE0DE20DD70DC80DB50D9E0DW:1664A909X:2C:166600W:16000AW:16010900W:16047E0D630D370D0A0CF60CE80CBF0B77FBE0FC4EFE57FE5BFDDCFC87FCD7FC56FDW:1664F011X:2C:166600W:16000AW:16010A00W:160465FCB3FC8BFC97FC1FFB8CFB0FFB3DFA6BFC53FC3CFC42FCAFFD2EFE91FEA7FEW:16645816X:2C:166600W:16000AW:16010B00W:1604C7FED5FF0BFE04FB88F98FF782F6C9F747F6D0FA02FE170029FF97FDF0FD06FFW:1664C115X:2C:166600W:16000AW:16010C00W:1604B7FF9BFF8AFF82FFA1FF93FFB4FF7CFF8DFF87FF1BFF21FEF5FED0FEE37D007DW:1664B917X:2C:166600W:16000AW:16010D00W:1604007D007D007D007D007D007D007D007D007D007D007D007D007D00000001C200W:16643307X:2C:166600W:16000AW:16010E00W:1604321068FFCE022600B40019006428635FFF6200321176A71803001404000AF000W:1664C008X:2C:166600W:16000AW:16010F00W:16040A05003201C21414000809F600003C004B0028003C3C01019036720414FFFFFFW:1664C207X:2C:166600W:16000AW:16011000W:1604FF0123456789ABCDEFFEDCBA9876543210013300D714940ABD07C6F71300000AW:16646C0DX:2C:166600W:16000AW:16011100W:16041964003C00000000000000000000000000000000000000000000000000000000W:1664D400X:2C:166600W:16000AW:16011200W:1604000000000000000000000000000000000002260201F402580202260E00000000W:1664CD01X:2C:166600W:16000AW:16011300W:1604000000000000000000009E484ED87D0A006401B0000A0E10FFFD440031002100W:16647F06X:2C:166600W:16000AW:16011400W:160401000320B25A6424540D71FD445078786E0A321E000A2D37000A7F070A0A4251W:16649607X:2C:166600W:16000AW:16011500W:160432373534582D4731009600AF004B00643209C4020A2811940211300000000000W:1664FD05X:2C:166600W:16000AW:16011600W:16040000000000000000000000000000000000000000000000000000000000000000W:16642000X:2C:166600W:16000AW:16011700W:160400000000000000000000000000000000000000000000000000000000FFFFFFFFW:16641D04X:2C:166600W:16000AW:16011800W:1604005500BD006B0073007C007E006B006F007400720079008200A000E4016603BCW:16647108X:2C:166600W:16000AW:16011900W:1604FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640320X:2C:166600W:16000AW:16011A00W:1604FFFF00BD006B0073007C007E006B006F007400720079008200A000E4016603BCW:16641C0AX:2C:166600W:16000AW:16011B00W:1604FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640520X:2C:166600W:16000AW:16011C00W:1604000000000000000000000000000000000002260201F402580202260E00000000W:1664D701X:2C:166600W:16000AW:16011D00W:1604000000000000000000009E484ED87D0A006401B0000A0E10FFFD440031002100W:16648906X:2C:166600W:16000AW:16011E00W:1604FFFFFFFF0000017FFFFFFE7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640B1CX:2C:166600W:16000AW:16011F00W:1604FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640920X:2C:166600W:160008W:16640800X:2C:1604486FW:160005W:16640500X:170C:160483FA729EW:160001W:16010000W:160305W:1604545415W:1664C300X:2C:166600W:160005W:16640500X:170C:1604D84E489EW:16000FW:16640F00X:4000
    
    NEW Flash Stream
    W:AA000100C:AA004105W:AA000200C:AA002402W:AA001404W:AA007236W:AA00FFFFW:AA00FFFFX:1000W:AA00000FX:1000W:1600030000W:16640300X:20C:166600W:160002000000EAFF3334FA33B5FA3330FF33E5FD33FFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3F24023F58CB33CB0008000000000000FFAA0EFBA70EFFA60EFFA10EFFA00EFEA30E4BA20ED2FF3AFFA10E5BA00EFFA30EW:16649635X:2C:166600W:1600020100005AA20EBDA50E04A40ECAFF3AFEA10E4BA00EFEA30E4BA20ECAFF3AC2FF3AD6FF33FFAF0E014F033F110CCDFF30D4FF352F100CD4FF35FFFF2301AF14014F033F110CC5FF30CCFF352F100CCCFF35FFFF23FFDF0BC4FF33B4F639FEAF16E5FF00W:1664AB2EX:2C:166600W:160005W:16640500X:170C:166600C:1604E2D034E2W:16000C00000083DEW:16646D01X:200C:166600W:16000A0000007E66376D9302F7B0FAF17FFF00060BB810680BA403E8002003E8002000201096W:1664030CX:2C:166600W:16000A0100000051F6C9F414520921326D00000000CFDC17F30000167A00000000D07E17DF00W:1664C709X:2C:166600W:16000A0200000017F300003A36FD910025300100EF0511050100001001003C00503C00643C00W:1664EE05X:2C:166600W:16000A03000020254F000006106CFF9CFEE8000102BC001403E8010002BC012C001E00C8C814W:16641009X:2C:166600W:16000A04000008003C0E10000A46050F050F0A0320006446500A0E530E530190006419DC5C60W:16648105X:2C:166600W:16000A05000000C800040332000100140001001403230708255A0F1E600AF000C82801F40000W:16645A05X:2C:166600W:16000A060000000000000000000043800400C800000114002B05000A138800C80A0028023210W:1664C703X:2C:166600W:16000A07000063103A100E0FF50FDD0FC10FA20F870F690F540F3E0F290F150F000EEB0ED20EW:16645D08X:2C:166600W:16000A080000BB0E9A0E7C0E650E4D0E370E260E170E0A0DFC0DEE0DE20DD70DC80DB50D9E0DW:1664A909X:2C:166600W:16000A0900007E0D630D370D0A0CF60CE80CBF0B77FBE0FC4EFE57FE5BFDDCFC87FCD7FC56FDW:1664F011X:2C:166600W:16000A0A000065FCB3FC8BFC97FC1FFB8CFB0FFB3DFA6BFC53FC3CFC42FCAFFD2EFE91FEA7FEW:16645816X:2C:166600W:16000A0B0000C7FED5FF0BFE04FB88F98FF782F6C9F747F6D0FA02FE170029FF97FDF0FD06FFW:1664C115X:2C:166600W:16000A0C0000B7FF9BFF8AFF82FFA1FF93FFB4FF7CFF8DFF87FF1BFF21FEF5FED0FEE37D007DW:1664B917X:2C:166600W:16000A0D0000007D007D007D007D007D007D007D007D007D007D007D007D007D00000001C200W:16643307X:2C:166600W:16000A0E0000321068FFCE022600B40019006428635FFF6200321176A71803001404000AF000W:1664C008X:2C:166600W:16000A0F00000A05003201C21414000809F600003C004B0028003C3C01019036720414FFFFFFW:1664C207X:2C:166600W:16000A100000FF0123456789ABCDEFFEDCBA9876543210013300D714940ABD07C6F71300000AW:16646C0DX:2C:166600W:16000A1100001964003C00000000000000000000000000000000000000000000000000000000W:1664D400X:2C:166600W:16000A120000000000000000000000000000000000000002260201F402580202260E00000000W:1664CD01X:2C:166600W:16000A130000000000000000000005009E484ED87D0A006401B0000A0E10FFFD440031002100W:16648406X:2C:166600W:16000A14000001000320B25A6424540D71FD445078786E0A321E000A2D37000A7F070A0A4251W:16649607X:2C:166600W:16000A15000032373534582D4731009600AF004B00643209C4020A2811940211300000000000W:1664FD05X:2C:166600W:16000A1600000000000000000000000000000000000000000000000000000000000000000000W:16642000X:2C:166600W:16000A17000000000000000000000000000000000000000000000000000000000000FFFFFFFFW:16641D04X:2C:166600W:16000A180000005500BD006B0073007C007E006B006F007400720079008200A000E4016603BCW:16647108X:2C:166600W:16000A190000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640320X:2C:166600W:16000A1A0000FFFF00BD006B0073007C007E006B006F007400720079008200A000E4016603BCW:16641C0AX:2C:166600W:16000A1B0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640520X:2C:166600W:16000A1C0000000000000000000000000000000000000002260201F402580202260E00000000W:1664D701X:2C:166600W:16000A1D0000000000000000000005009E484ED87D0A006401B0000A0E10FFFD440031002100W:16648E06X:2C:166600W:16000A1E0000FFFFFFFF0000018AFFFFFE74FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640B1CX:2C:166600W:16000A1F0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640920X:2C:166600W:160008W:16640800X:2C:166600C:1604266FW:160005W:16640500X:170C:166600C:1604E2D034E2W:160001000005545415W:1664C300X:20C:166600W:160005W:16640500X:170C:166600C:160437250AE2W:16000FW:16640F00X:4000
    

  • The flash stream files should match IF (!) you created them with the exact same version of bqStudio and the gauge plug-in for bqStudio (.bqz file).

    The comparison between the two files hints to a change in bqStudio version between the two of them.
  • Thanks for acknowledging, but I am still left with no solution or even direction.

    Where can I go from here? Can I download an earlier version of bqStudio? Is there an update to the algorithm you must have provided to send the flash stream to your device via our microcontroller?

    Please forgive me, but I'm flying blind. This work was all done a few years ago by a contract firm and TI. The contract firm has no documentation and tells me TI did all the work and provided the code that is now failing when sending. Can you verify if this is true.

    Thanks
  • How does it fail? Does a comparison not succeed? Please provide more details.

    Thanks,
    Dominik.
  • Yes that is correct. It fails at a compare. After some debugging I find that I get compare fails at these I2C addresses and array indexes (for the generated flash stream array):

    0x04, 635

    0x04, 3928

    0x04, 4015

    Interestingly the first two are identical, reading and comparing the same data at the same address? I'm trying to investigate more into what the error was exactly.

    There are also some other boundary type parameters that I had to adjust.

    bqStudio Generated Flash Stream 12/14/2016
    
    W:AA000100C:AA004105W:AA000200C:AA002402W:AA001404W:AA007236W:AA00FFFFW:AA00FFFFX:1000W:AA00000FX:1000W:1600030000W:16640300X:20C:166600W:160002000000EAFF3334FA33B5FA3330FF33E5FD33FFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3FFFFF3F24023F58CB33CB0008000000000000FFAA0EFBA70EFFA60EFFA10EFFA00EFEA30E4BA20ED2FF3AFFA10E5BA00EFFA30EW:16649635X:2C:166600W:1600020100005AA20EBDA50E04A40ECAFF3AFEA10E4BA00EFEA30E4BA20ECAFF3AC2FF3AD6FF33FFAF0E014F033F110CCDFF30D4FF352F100CD4FF35FFFF2301AF14014F033F110CC5FF30CCFF352F100CCCFF35FFFF23FFDF0BC4FF33B4F639FEAF16E5FF00W:1664AB2EX:2C:166600W:160005W:16640500X:170C:166600C:1604E2D034E2W:16000C00000083DEW:16646D01X:200C:166600W:16000A0000007E66376D9302F7B0FAF17FFF00060BB810680BA403E8002003E8002000201096W:1664030CX:2C:166600W:16000A0100000051F6C9F414520921326D00000000CFDC17F30000167A00000000D07E17DF00W:1664C709X:2C:166600W:16000A0200000017F300003A36FD910025300100EF0511050100001001003C00503C00643C00W:1664EE05X:2C:166600W:16000A03000020254F000006106CFF9CFEE8000102BC001403E8010002BC012C001E00C8C814W:16641009X:2C:166600W:16000A04000008003C0E10000A46050F050F0A0320006446500A0E530E530190006419DC5C60W:16648105X:2C:166600W:16000A05000000C800040332000100140001001403230708255A0F1E600AF000C82801F40000W:16645A05X:2C:166600W:16000A060000000000000000000043800400C800000114002B05000A138800C80A0028023210W:1664C703X:2C:166600W:16000A07000063103A100E0FF50FDD0FC10FA20F870F690F540F3E0F290F150F000EEB0ED20EW:16645D08X:2C:166600W:16000A080000BB0E9A0E7C0E650E4D0E370E260E170E0A0DFC0DEE0DE20DD70DC80DB50D9E0DW:1664A909X:2C:166600W:16000A0900007E0D630D370D0A0CF60CE80CBF0B77FBE0FC4EFE57FE5BFDDCFC87FCD7FC56FDW:1664F011X:2C:166600W:16000A0A000065FCB3FC8BFC97FC1FFB8CFB0FFB3DFA6BFC53FC3CFC42FCAFFD2EFE91FEA7FEW:16645816X:2C:166600W:16000A0B0000C7FED5FF0BFE04FB88F98FF782F6C9F747F6D0FA02FE170029FF97FDF0FD06FFW:1664C115X:2C:166600W:16000A0C0000B7FF9BFF8AFF82FFA1FF93FFB4FF7CFF8DFF87FF1BFF21FEF5FED0FEE37D007DW:1664B917X:2C:166600W:16000A0D0000007D007D007D007D007D007D007D007D007D007D007D007D007D00000001C200W:16643307X:2C:166600W:16000A0E0000321068FFCE022600B40019006428635FFF6200321176A71803001404000AF000W:1664C008X:2C:166600W:16000A0F00000A05003201C21414000809F600003C004B0028003C3C01019036720414FFFFFFW:1664C207X:2C:166600W:16000A100000FF0123456789ABCDEFFEDCBA9876543210013300D714940ABD07C6F71300000AW:16646C0DX:2C:166600W:16000A1100001964003C00000000000000000000000000000000000000000000000000000000W:1664D400X:2C:166600W:16000A120000000000000000000000000000000000000002260201F402580202260E00000000W:1664CD01X:2C:166600W:16000A130000000000000000000005009E484ED87D0A006401B0000A0E10FFFD440031002100W:16648406X:2C:166600W:16000A14000001000320B25A6424540D71FD445078786E0A321E000A2D37000A7F070A0A4251W:16649607X:2C:166600W:16000A15000032373534582D4731009600AF004B00643209C4020A2811940211300000000000W:1664FD05X:2C:166600W:16000A1600000000000000000000000000000000000000000000000000000000000000000000W:16642000X:2C:166600W:16000A17000000000000000000000000000000000000000000000000000000000000FFFFFFFFW:16641D04X:2C:166600W:16000A180000005500BD006B0073007C007E006B006F007400720079008200A000E4016603BCW:16647108X:2C:166600W:16000A190000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640320X:2C:166600W:16000A1A0000FFFF00BD006B0073007C007E006B006F007400720079008200A000E4016603BCW:16641C0AX:2C:166600W:16000A1B0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640520X:2C:166600W:16000A1C0000000000000000000000000000000000000002260201F402580202260E00000000W:1664D701X:2C:166600W:16000A1D0000000000000000000005009E484ED87D0A006401B0000A0E10FFFD440031002100W:16648E06X:2C:166600W:16000A1E0000FFFFFFFF0000018AFFFFFE74FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640B1CX:2C:166600W:16000A1F0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFW:16640920X:2C:166600W:160008W:16640800X:2C:166600C:1604266FW:160005W:16640500X:170C:166600C:1604E2D034E2W:160001000005545415W:1664C300X:20C:166600W:160005W:16640500X:170C:166600C:160437250AE2W:16000FW:16640F00X:4000
    

  • Here is some more detail for the issue I'm seeing.

    For the 3 compares failing above, the values coming back from the I2C read do not match the array values.

    The values I read from the FG in the same order as above:

    @ index: 635 (points to after the last char of the compare bytes, ie. C:1604E2D034E2 <--)
    array value: E2 D0 34 E2
    FG rx value: 83 FA 72 9E

    @ index: 3928
    array value: E2 D0 34 E2
    FG rx value: 83 FA 72 9E

    @ index: 4015
    array value: 37 25 0A E2
    FG rx value: D8 4E 48 9E
  • Are you able to test and verify the flash stream file with bqStudio and an EVM first before moving on to your uC?
    It's extremely difficult to figure out what's wrong without a reference.
  • We only bought the EV2300 as one of your suggestions. But, we do have one of our PCBs with the with the BQ5471 100% isolated on the I2C bus. The uC is even removed. Same issues. I have verified there are no I2C bus errors.

    I have tried to be patient but you have yet to make any effort to answer many of my questions, or even attempted to help me understand why something like this would happen. You have obviously seen something like this before, since you knew exactly what the error would be without my telling you. So please, why would this device have a compare issue? Is all the data not previously written before the compare? Can that not be verified in the Golden Image I've sent (flash stream)?

    Also, I still don't know how the code (for our Micro) that send the stream was generated. Was that algorithm ever updated along with bqStudio updates,considering how different version of bqStudio output different images? 

  • The comparison errors that you get can be due to many different reasons. I really can't determine the cause based on the information that you provided.

    The obvious element in a flash stream file that can fail is the compare command - that's why I suggested checking that.

    I can't decode the modified flash stream file which was converted into a buffer for your code. If there's even one small error in your code or in the transformation from a .fs file into the header file / buffer then you'll likely get comparison errors.

    My suggestion to resolve this problem is to first make sure that the flash stream file works correctly on a validated software platform: bqStudio, connected via an EV2x00 to your gauge on your board (or connect it to an EVM) and if that works then you can convert the flash stream file to your software's format.

    I don't know how the code for your uC was generated or who wrote it. It doesn't looks like official code from TI.

    The file that you attached was already modified and I cannot work with this file format because I have no tools that can analyze this modified format.
    If you attach an original, unmodified flash stream file then I can check if this file is correct. Analyzing a modified file format is outside the scope of E2E support.
  • Previously I tried to use the "programming" tab in bqStudio to send the .df.fs file, but all that would happen is a dialog window would pop up and disappear. Too fast to read. I just figured that function didn't work since I also couldn't find it in the bqStudio documentation (help contents menu).

    I just tried again, by resetting the app, the EV board, and my FG. Rebuilt the golden image, then tried to program image under the "programming" tab. This time a progress window actually showed up, but when doing this the process crashes with a few fleeting red error comments at the bottom left corner. Too fast to follow. Now my device is in an unrecoverable state. I'll have to go try to get another board to work with.

    You may not know exactly how our code was generated, but could you maybe offer a bit more info to help me know what I don't know? For instance, is there an app note, or design guide, or code examples for someone to generate the code that sends the stream to the FG? Or are we the only customer you have that does this?

  • Attached is the new golden image.

    ;--------------------------------------------------------
    ;Verify Existing Firmware Version
    ;--------------------------------------------------------
    W: AA 00 01 00
    C: AA 00 41 05
    W: AA 00 02 00
    C: AA 00 24 02
    ;--------------------------------------------------------
    ;Unseal device
    ;--------------------------------------------------------
    W: AA 00 14 04
    W: AA 00 72 36
    W: AA 00 FF FF
    W: AA 00 FF FF
    X: 1000
    ;--------------------------------------------------------
    ;Go To ROM Mode
    ;--------------------------------------------------------
    W: AA 00 00 0F
    X: 1000
    W: 16 00 03 00 00
    W: 16 64 03 00
    X: 20
    C: 16 66 00
    W: 16 00 02 00 00 00 EA FF 33 34 FA 33 B5 FA 33 30 FF 33 E5 FD 33 FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F 24 02 3F 58 CB 33 CB 00 08 00 00 00 00 00 00 FF AA 0E FB A7 0E FF A6 0E FF A1 0E FF A0 0E FE A3 0E 4B A2 0E D2 FF 3A FF A1 0E 5B A0 0E FF A3 0E
    W: 16 64 96 35
    X: 2
    C: 16 66 00
    W: 16 00 02 01 00 00 5A A2 0E BD A5 0E 04 A4 0E CA FF 3A FE A1 0E 4B A0 0E FE A3 0E 4B A2 0E CA FF 3A C2 FF 3A D6 FF 33 FF AF 0E 01 4F 03 3F 11 0C CD FF 30 D4 FF 35 2F 10 0C D4 FF 35 FF FF 23 01 AF 14 01 4F 03 3F 11 0C C5 FF 30 CC FF 35 2F 10 0C CC FF 35 FF FF 23 FF DF 0B C4 FF 33 B4 F6 39 FE AF 16 E5 FF 00
    W: 16 64 AB 2E
    X: 2
    C: 16 66 00
    W: 16 00 05
    W: 16 64 05 00
    X: 170
    C: 16 66 00
    C: 16 04 99 38 90 D5
    W: 16 00 0C 00 00 00 83 DE
    W: 16 64 6D 01
    X: 200
    C: 16 66 00
    W: 16 00 0A 00 00 00 7E 66 31 F9 93 02 F7 B1 FA EE FF FF 00 06 0B B8 10 68 0B A4 03 E8 00 20 03 E8 00 20 00 20 10 96
    W: 16 64 07 0D
    X: 2
    C: 16 66 00
    W: 16 00 0A 01 00 00 00 51 F6 C9 F4 14 52 09 21 32 6D 00 00 00 00 CF DC 17 F3 00 00 16 7A 00 00 00 00 D0 7E 17 DF 00
    W: 16 64 C7 09
    X: 2
    C: 16 66 00
    W: 16 00 0A 02 00 00 00 17 F3 00 00 3A 36 FD 91 00 25 30 01 00 EF 05 11 05 01 00 00 10 01 00 3C 00 50 3C 00 64 3C 00
    W: 16 64 EE 05
    X: 2
    C: 16 66 00
    W: 16 00 0A 03 00 00 20 25 4F 00 00 06 10 6C FF 9C FF 8F 00 01 02 BC 00 02 03 E8 01 00 02 BC 01 2C 00 1E 00 C8 C8 14
    W: 16 64 A6 08
    X: 2
    C: 16 66 00
    W: 16 00 0A 04 00 00 08 00 3C 0E 10 00 0A 46 05 0F 05 0F 0A 03 20 00 64 46 50 0A 0E 53 0E 53 01 90 00 64 19 DC 5C 60
    W: 16 64 81 05
    X: 2
    C: 16 66 00
    W: 16 00 0A 05 00 00 00 C8 00 04 03 32 00 01 00 14 00 01 00 14 03 23 07 08 25 5A 0F 1E 60 0A F0 00 C8 28 01 F4 00 00
    W: 16 64 5A 05
    X: 2
    C: 16 66 00
    W: 16 00 0A 06 00 00 00 00 00 00 00 00 00 00 43 80 04 00 C8 00 00 01 14 00 2B 05 00 0A 13 88 00 C8 0A 00 28 20 06 10
    W: 16 64 B9 03
    X: 2
    C: 16 66 00
    W: 16 00 0A 07 00 00 63 10 3A 10 0E 0F F5 0F DD 0F C1 0F A2 0F 87 0F 69 0F 54 0F 3E 0F 29 0F 15 0F 00 0E EB 0E D2 0E
    W: 16 64 5D 08
    X: 2
    C: 16 66 00
    W: 16 00 0A 08 00 00 BB 0E 9A 0E 7C 0E 65 0E 4D 0E 37 0E 26 0E 17 0E 0A 0D FC 0D EE 0D E2 0D D7 0D C8 0D B5 0D 9E 0D
    W: 16 64 A9 09
    X: 2
    C: 16 66 00
    W: 16 00 0A 09 00 00 7E 0D 63 0D 37 0D 0A 0C F6 0C E8 0C BF 0B 77 FB E0 FC 4E FE 57 FE 5B FD DC FC 87 FC D7 FC 56 FD
    W: 16 64 F0 11
    X: 2
    C: 16 66 00
    W: 16 00 0A 0A 00 00 65 FC B3 FC 8B FC 97 FC 1F FB 8C FB 0F FB 3D FA 6B FC 53 FC 3C FC 42 FC AF FD 2E FE 91 FE A7 FE
    W: 16 64 58 16
    X: 2
    C: 16 66 00
    W: 16 00 0A 0B 00 00 C7 FE D5 FF 0B FE 04 FB 88 F9 8F F7 82 F6 C9 F7 47 F6 D0 FA 02 FE 17 00 29 FF 97 FD F0 FD 06 FF
    W: 16 64 C1 15
    X: 2
    C: 16 66 00
    W: 16 00 0A 0C 00 00 B7 FF 9B FF 8A FF 82 FF A1 FF 93 FF B4 FF 7C FF 8D FF 87 FF 1B FF 21 FE F5 FE D0 FE E3 7D 00 7D
    W: 16 64 B9 17
    X: 2
    C: 16 66 00
    W: 16 00 0A 0D 00 00 00 7D 00 7D 00 7D 00 7D 00 7D 00 7D 00 7D 00 7D 00 7D 00 7D 00 7D 00 7D 00 7D 00 00 00 01 C2 00
    W: 16 64 33 07
    X: 2
    C: 16 66 00
    W: 16 00 0A 0E 00 00 32 10 68 FF CE 02 26 00 B4 00 19 00 64 28 63 5F FF 62 00 32 11 76 A7 18 03 00 14 04 00 0A F0 00
    W: 16 64 C0 08
    X: 2
    C: 16 66 00
    W: 16 00 0A 0F 00 00 0A 05 00 32 01 C2 14 14 00 08 09 F6 00 00 3C 00 4B 00 28 00 3C 3C 01 01 90 36 72 04 14 FF FF FF
    W: 16 64 C2 07
    X: 2
    C: 16 66 00
    W: 16 00 0A 10 00 00 FF 01 23 45 67 89 AB CD EF FE DC BA 98 76 54 32 10 01 68 00 D7 14 94 0A BD 07 C6 F7 13 00 04 0A
    W: 16 64 A5 0D
    X: 2
    C: 16 66 00
    W: 16 00 0A 11 00 00 19 64 00 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    W: 16 64 D4 00
    X: 2
    C: 16 66 00
    W: 16 00 0A 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 26 02 01 F4 02 58 02 02 26 0E 00 00 00 00
    W: 16 64 CD 01
    X: 2
    C: 16 66 00
    W: 16 00 0A 13 00 00 00 00 00 00 00 00 00 00 0A 00 9E 48 4E D8 7D 0A 00 64 01 B0 00 0A 0E 10 FF FD 44 00 31 00 21 00
    W: 16 64 89 06
    X: 2
    C: 16 66 00
    W: 16 00 0A 14 00 00 01 00 03 23 55 5A 64 27 42 0E 86 FD 44 50 78 78 6E 0A 32 1E 00 0A 2D 37 00 0A 7F 07 0A 0A 42 51
    W: 16 64 43 07
    X: 2
    C: 16 66 00
    W: 16 00 0A 15 00 00 32 37 35 34 58 2D 47 31 00 96 00 AF 00 4B 00 64 32 09 C4 02 0A 28 11 94 02 11 30 00 00 00 00 00
    W: 16 64 FD 05
    X: 2
    C: 16 66 00
    W: 16 00 0A 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    W: 16 64 20 00
    X: 2
    C: 16 66 00
    W: 16 00 0A 17 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF FF FF
    W: 16 64 1D 04
    X: 2
    C: 16 66 00
    W: 16 00 0A 18 00 00 00 00 00 BD 00 6B 00 73 00 7C 00 7E 00 6B 00 6F 00 74 00 72 00 79 00 82 00 A0 00 E4 01 66 03 BC
    W: 16 64 1C 08
    X: 2
    C: 16 66 00
    W: 16 00 0A 19 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    W: 16 64 03 20
    X: 2
    C: 16 66 00
    W: 16 00 0A 1A 00 00 00 55 00 FE 00 90 00 9A 00 A6 00 A9 00 90 00 95 00 9C 00 99 00 A2 00 AE 00 D7 01 32 01 E0 05 02
    W: 16 64 8C 09
    X: 2
    C: 16 66 00
    W: 16 00 0A 1B 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    W: 16 64 05 20
    X: 2
    C: 16 66 00
    W: 16 00 0A 1C 00 00 FF 01 23 45 67 89 AB CD EF FE DC BA 98 76 54 32 10 01 68 00 D7 14 94 0A BD 07 C6 F7 13 00 04 0A
    W: 16 64 B1 0D
    X: 2
    C: 16 66 00
    W: 16 00 0A 1D 00 00 19 64 00 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    W: 16 64 E0 00
    X: 2
    C: 16 66 00
    W: 16 00 0A 1E 00 00 FF FF FF FF 00 00 01 D6 FF FF FE 28 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    W: 16 64 0B 1C
    X: 2
    C: 16 66 00
    W: 16 00 0A 1F 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    W: 16 64 09 20
    X: 2
    C: 16 66 00
    W: 16 00 08
    W: 16 64 08 00
    X: 2
    C: 16 66 00
    C: 16 04 E4 74
    W: 16 00 05
    W: 16 64 05 00
    X: 170
    C: 16 66 00
    C: 16 04 99 38 90 D5
    W: 16 00 01 00 00 05 54 54 15
    W: 16 64 C3 00
    X: 20
    C: 16 66 00
    W: 16 00 05
    W: 16 64 05 00
    X: 170
    C: 16 66 00
    C: 16 04 EE 8C 65 D5
    ;--------------------------------------------------------
    ;Execute Flash Code
    ;--------------------------------------------------------
    W: 16 00 0F
    W: 16 64 0F 00
    X: 4000