Skip to main content
ldong.1
Associate III
July 29, 2022
Question

Reqeust for L9369 CRC calculation documentation.

  • July 29, 2022
  • 2 replies
  • 1798 views

Hi. i'm working with L9369 H-bridge driver and i want to know how to calculate CRC code in C programming

Do you have any documentation regarding CRC implementation in C code?

thank you.

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
July 29, 2022

Would need an actual Data Sheet, not the Data Brief to determine this

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
ldong.1
ldong.1Author
Associate III
July 29, 2022

thanks for your replying.

i have L9369 Datasheet and it says it use X^5+X^2+1 as polynomial. and it use "11111(0x1F)" as initial value.

i don't know how to implement CRC Table and get CRC value by C programing. please help me.

thank you.

Tesla DeLorean
Guru
July 29, 2022

A table may or may not be appropriate, depends on how the data needs to be processed.

Could you just use a simple bit-wise application of the polynomial?

0x25 (0x05)

ie something like, assuming a right shift, MSB fed

if (crc & 0x10)

crc = (crc << 1) ^ 0x25; // this has the secondary effect of clearing the high order bit

else

crc <<=1;

Do you have some example words / test patterns?

Send me the full data sheet or attach.

sourcer32@gmail.com

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..