Computer Interfacing
Discussions about interfacing and electronics
 

Yet another CRC CCITT


 

       Computer Interfacing Forum Index -> Error detection and correction
Author Message
Snamprogetti
New User



Joined: 17 Apr 2009
Posts: 3
Location: Italia

Apr 17, 2009 1:59 pm

Hello, i can't get an UPS device to accept my CRC values.
The specs say: standard CRC-CCITT 16 bit, 1021h polynom, 554Dh initial value. I tried many algorithms with these specs, but i never get what the device wants. I know it wants for example:

data 20 22 52 53 30 30 -> CRC 9087h

Thanks for any help
regregex
Preferred Member



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

Apr 17, 2009 5:28 pm

Hello Snamprogetti, welcome to the forum.

The documentation is correct, except the initial vector has already been reversed to match the CRC-CCITT algorithm which shifts right instead of left. In Rocksoft™ notation it would be:
Code:
   Width  : 16
   Poly   : 1021
   Init   : B2AA
   RefIn  : True
   RefOut : True
   XorOut : 0000
   Check  : 63D0
(For an explanation of this record, see A Painless Guide to CRC Error Detection Algorithms by Ross Williams.)
(For a generic implementation in C, see A Painless Guide or the Calculator page.)

Also, could you please tell me the make and model of the UPS so I can add this algo to my catalogue?

HTH

--Greg
Snamprogetti
New User



Joined: 17 Apr 2009
Posts: 3
Location: Italia

Apr 20, 2009 9:16 am

Thank you. It is a Dialog by Riello.
I solved because they sent me their own source code.
Actually all other algorithms i've tried (i haven't tried lammertbies.nl's one though) don't give that result even using B2AA (see zorc.breitbandkatze.de/crc.html for example)
Snamprogetti
New User



Joined: 17 Apr 2009
Posts: 3
Location: Italia

Apr 20, 2009 9:21 am

Sorry last example works but you also have to reverse data bytes and CRC result.
regregex
Preferred Member



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

Apr 20, 2009 11:54 am

Thank you for the reference.

--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