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.

BQ78350-R1: BQ78350-R1 PEC Calculation Problem

Part Number: BQ78350-R1
Other Parts Discussed in Thread: BQ78350

Hello 

I am getting data from BQ78350-R1 with MCU. I'm having trouble with the PEC calculation. Calculated value and incoming value doesnt match

For Example; 
I send command to 0x0D to read SOC(Relative State Of Charge). (MCU to BQ78350-R1) .

And read 3byte data. (BQ78350 to MCU) 
0x1D, 0x00 , 0x0A (SOC value is 29%. This is ok) 
So Data= 001D , CRC= 0A. 

I don't understand how to calculate this crc value. 
0x16 
0x0D(Command for SOC)
0x17
0x1D
0x00

According to this table, the CRC value is 0x8D. ( https://crccalc.com/    i calculate for CRC-8 from website)

But I get 0A as CRC value from BQ78350-R1. 
What is in the pack when calculating CRC? How is the CRC value calculated? 


logic analyzer data in communication



Fatih

  • Hello Faith,

    You normally be right, it should be 0x8D, however, I see a stop in your signal after the command byte.

    I believe the CRC is calculated after this stop, so it uses the last three bytes to calculate the CRC (0x17 0x1D 0x00) which would equal to 0x0A. So the CRC calculated I would recommend you look Figure 1 in the application report SMBus Made Simple. When using repeated starts, the CRC uses all the bytes to calculate the CRC, which would equal to 0x8D. 

    Best Regards,

    Luis J. Hernandez Salomon