简体   繁体   中英

Unable to get the correct CRC16 with a given Polynomial

I'm struggling with an old radiation sensor and his communication protocol.
The sensor is event driven, the master starts the communication with a data transmission or a data request.
Each data telegram uses a CRC16 to check only the variable data block and a CRC8 to check all the telegram.

My main problem is the crc16, According to the datasheet the poly used to check the data block is:
CRC16 = X^14 + X^12 + X^5 + 1 --> 0x5021 ??

I captured some data with a valid CRC16 and tried to replicate the expected value in order to send my own data transmission, but I can't get the same value.
I'm using the sunshine CRC calculator trying any possible combination with that poly. I also try CRC Reveng but no results.

Here are a few data with the correct CRC16:.

    Data    | CRC16 (MSB LSB)
14 00 00 0A | 1B 84
15 00 00 0C | 15 88
16 00 00 18 | 08 1D
00 00 00 00 | 00 00
00 00 00 01 | 19 D8
00 00 00 02 | 33 B0
01 00 00 00 | 5A DC
08 00 00 00 | c6 c2
10 00 00 00 | 85 95
80 00 00 00 | 0C EC
ff ff ff ff | f3 99

If I send an invalid CRC16 in the telegram, the sensor send a negative acknowledge with the expected value, so I can try any data in order to test or get more examples if needed.

if useful, the sensor uses a 8bit 8051 microprocessor, and this is an example of a valid CRC8 checked with sunshine CRC :

CRC8 = X^8 + X^6 + X^3 + 1 --> 0x49
Input reflected   Result reflected

    control byte    |    Data   |CRC16 |  CRC8
01 0E 01 00 24 2A 06 ff ff ff ff f3 99 |-> 0F

Any help is appreciated !

Looks like a typo on the polynomial. An n -bit CRC polynomial always starts with x n . Like your correct 8-bit polynomial. The 16-bit polynomial should read X 16 + X 12 + X 5 + 1, which in fact is a very common 16-bit CRC polynomial.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM