Search code examples
serial-portframechecksumcrc

Calculating FCS(CRC) for HDLC frame


I have the following frame:

7e  01 00  00  01  00  18  ef  00  00  00   b5   20 c1 05 10 02 71 2e 1a c2 05 10 01 71 00 6e 87 02 00 01 42 71 2e 1a 01 96 27 be 27 54 17 3d b9 93 ac 7e

If I understand correctly, then it is this portion of the frame on which the FCS is calculated:

010000010018ef000000b520c1051002712e1ac205100171006e8702000142712e1a019627be2754173db9

I've tried entering this into a number of online calculators but I cant produce 0x93ac from the above data.

http://www.lammertbies.nl/comm/info/crc-calculation.html with input type hex.

How is 0x93ac arrived at?

Thanks,

Barry


Solution

  • First of all, CRC value is 0xac93

    Use this calculator: http://www.zorc.breitbandkatze.de/crc.html

    • Set CRC order 16
    • Polynomial 1021
    • Initial value ffff
    • Final value ffff
    • "reverse data bytes"
    • "reverse CRC result before Final XOR"
    • Enter your sequence as:

      %01%00%00%01%00%18%ef%00%00%00%b5%20%c1%05%10%02%71%2e%1a%c2%05%10%01%71%00%6e%87%02%00%01%42%71%2e%1a%01%96%27%be%27%54%17%3d%b9
      
    • Press "calculate" and you get 0xAC93