How to calculate CRC 16 with polynomial x16 + x12 + x5 + 1

I am trying to interact with some kind of system and in their specifications they need to calculate CRC 16 for serial communication. Here is an excerpt from the documentation

"16 bits CCITT CRC messages using the standard polynomial X16 + X12 + X5 +1. Seed values ​​are always 0 (zero)."

First of all, I found only 2-3 samples of C # code, how to do this, and none of them give me the correct value. I tried this http://www.sanity-free.com/133/crc_16_ccitt_in_csharp.html , but I'm not sure what to set for the initial value. I tried zeros and still not working.

The data I'm testing is:

0x00 0x09 0x10 0x01 0x01 0x7C 0xF4 0xB8 0x00, 

the CRC value that I get is

 0xF2 0x24, 

however their system says that it should be

 0xC0 0x2F 

I understand that the polynomial x16 + x12 + x5 + 1 = 0x11021, however even when I use this code in the code, it still gives me the wrong answer. What am I doing wrong?

+7
source share
1 answer

I get it. I had to use CRC16-CCITT Kermit inmplementation. I think their documentation should be updated as it uses a different polynomial.

http://www.sanity-free.com/147/standard_crc16_and_crc16_kermit_implementation_in_csharp.html

+10
source

All Articles