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.

BQ27542EVM: BQ27542EVM: Current correction ccGain and floating point conversion are incorrect.

Part Number: BQ27542EVM

Hi 

I have a query need your help.

CC Offset=0xFA89;

Board Offset=0xAF; CC Gain=0x805851A8(5.573mohm)

Corrected CC Delta=0x94761F72(5.550mohm)

According to the formula: 4.768/x=5.573, then X=0.8555535618158981.

I can't find the relationship between floating point numbers: 0.8555535618158981 and 0x805851A8.

Is there something wrong with this formula?

float ccGain = (float)(knownCurrent / (float)(avgRawData - ((ccOffset + (int)boardOffset) / 16)));

Waiting for your reply.

Thanks

Star

  • Hi Star,

    Based on this example from the bq27542 TRM, I believe that the formula itself looks the same.

    Can you please go more into depth about what you mean by the relationship between the floating point numbers?

    Regards,

    Anthony Baldino

  • Hi Anthony 

    Thanks for your reply.

    There is no problem with the process, but the value obtained by ccGain is wrong.

    send_extendedCommand(0X3E, 0x00, 0x68);

    read_Block();

    int ccOffset = (((uint16_t) block[8] << 8) + (uint16_t) block[9]);

    signed char boardOffset = block[10];

    float ccGain = (float) (knownCurrent/ (float) ((int) avgRawData - ((ccOffset + boardOffset) / 16)));

    The value of  float CCGain is incorrect. After writing to bq27542, CC Gain and CC Delta deviate greatly, resulting in inaccurate current.

    Please help check it.

    Thanks

    Star

  • Hi Star,

    Can you confirm that the code you are using for this example is from the Host System Calibration Method document?

    Regards,

    Anthony Baldino