Computer Interfacing
Discussions about interfacing and electronics
 

Can't find Correct CRC-CCITT algorithm


 

       Computer Interfacing Forum Index -> Error detection and correction
Author Message
kilobravo
Guest







Jun 16, 2008 3:52 pm

Hi,

I'm trying to write a CRC-CCITT verification routine for a serial communication link. The documentation states that it is a "16 bit CRC-CCITT" check. I'm given a couple of simple inputs/outputs, but none of the techniques I've ever used seem to work:

#1) input - 0x3a 0x71
correct CRC - 0xd9 0x64

#2) input - 0x3a 0x91
correct CRC - 0x3e 0x6a

Any help would be greatly appreciated
regregex
Preferred Member



Joined: 30 Oct 2007
Posts: 184
Location: London, UK

Jun 20, 2008 1:04 am

Hello kilobravo, welcome to the forum.

The algorithm needed is one I've only seen before on the Microchip MCRF4XX series:
Code:
   Name   : "CRC-16/MCRF4XX"
   Width  : 16
   Poly   : 1021
   Init   : FFFF
   RefIn  : True
   RefOut : True
   XorOut : 0000
   Check  : 6F91
(For an explanation of this record, see A Painless Guide to CRC Error Detection Algorithms.) (Search for filename "crc_v3.txt".)
(For a generic implementation in C, see A Painless Guide or the Calculator page.)

The algorithm is related to:
  • HDLC (X.25) except the final result is not XORed with 0xffff.
  • MODBUS except the polynomial is 0x1021.
HTH.

Greg

       Computer Interfacing Forum Index -> Error detection and correction
Page 1 of 1



Running on php BB © 2001, 2009 php BB Group
   Lammert Bies     Interfacing     Sitemap     Forum