# Mc33771B - CRC

cancel
Showing results for
Show  only  | Search instead for
Did you mean:

## Mc33771B - CRC

462 Views
Contributor III

Dear Community,

how do I calculate the CRC? In data sheet Battery cell controller IC (nxp.com) chapter 10.3 It's explained but I don't fully understand it.

is CRC 0x22 the result?
As far as I understand, the transmitted message consists of the seed value, data  bit, master/slave bit and memory address bit, physical address bit, command bit and 8 subsequent zeros.

Thus the binary number from example would look like this:

1111 1111 0000 0001 0000 0001 0000 1000 0001 0000 0000 0000

The polynomial is 0x2F thus 0010 1111.

The transmitted bits are compared with the polynomial via XOR.

Is the first 1 from the polynomial placed opposite the 1 from the message? Like this:

1111 1111 0000 0001 0000 0001 0000 1000 0001 0000 0000 0000

1011 11

I don't know how to get exactly 0x22.

best regards,

Patrick

3 Replies
444 Views
NXP TechSupport

Hello Patrick_Pavle,

I hope all is great with you. Thank you for using the NXP communities.

In this case, I do recommend the following post for further information.

https://community.nxp.com/t5/Sensors/MC33771C-CRC/td-p/1748751

I hope this information helps.

Regards,

David

440 Views
Contributor III

Hello @diazmarin09 ,

thank you for that!
I actually wanted to have a basic understanding of it.

But why is 0x42 used as the seed value in the code? Shouldn´t it be 0FF?

best regards,

Patrick

Tags (2)
386 Views
NXP TechSupport

Hello Patrick,

Please review the response from our specialist below:

Polynom and Seed are different parameters you can either use the seed 0xFF and shift an additional 0x00 or simply use the seed 0x42 (the result of the first unnecessary shift) I remember that we "fixed" explained that in the datasheet.

Therefore, you can use both 0xFF or 0x42. The sample code previously shared can be useful for you.

Regards,

David