Mc33771B - CRC

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Mc33771B - CRC

353件の閲覧回数
Patrick_Pavle
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. 

Patrick_Pavle_0-1707138634728.png

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

 

 

0 件の賞賛
返信
3 返答(返信)

335件の閲覧回数
diazmarin09
NXP TechSupport
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

0 件の賞賛
返信

331件の閲覧回数
Patrick_Pavle
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 

 
 
タグ(2)
0 件の賞賛
返信

277件の閲覧回数
diazmarin09
NXP TechSupport
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

0 件の賞賛
返信