Tool/software:
Hi Team,
I am trying to write a code to calculate the crc via software and compare it with the CRC byte communicated by the gauge while reading certain registers(Let's take the Voltage Register 0x09 for example).
I consulted the following application note by the TI "Calculating CRC With TI Battery Management Products(SLUA363)", but I am unable to calculate the correct CRC. I can not find any document for the BQ40z80 neither can I find any other thread for the same. According to the application note, the CRC depends the most on the polynomial and the CRC seed you start with. I am keeping the polynomial as 0x8C and seed as 0x00.
Let's say the voltage returned is 0x40A1. I am using an I2C controller, so am receiving the data as 0xa1,0x40 and 0xa1(calculated CRC). However the CRC calculated via the steps indicated in the above method is different. Please note that I am calculating the CRC for 0x40 first and then using the CRC I receive from that as a seed to calculate the CRC for 0xA1.
if anyone can guide me to calculate the CRC in the correct manner it would be very helpful.