Computer Interfacing
Discussions about interfacing and electronics
 

Serial data CRC-8?

How to calculate this CRC-8


 

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



Joined: 31 Jul 2013
Posts: 2


Aug 02, 2013 8:01 am

Hello,

For my home domotica system I need to have information from an programmable controller.
This controller (Satchwell MN500) communicates with the Satchwell Native Communication Protocol.
I already have experience calculating Checksums for serial data, but this one I think does not use Checksum but CRC.

Below are 5 strings in Hex, all asking for the same data.
Strange is that byte 8 and byte 9 change with every new request for the same data.
They start with 00 00 and only roll over if FF FF is reached.
Below are 4 request for the same data from the controller:
AA 00 01 FF 01 01 00 88 00 00 92 02 00 00 4B
AA 00 01 FF 01 01 00 88 01 00 92 02 00 00 C8
AA 00 01 FF 01 01 00 88 02 00 92 02 00 00 4E
AA 00 01 FF 01 01 00 88 03 00 92 02 00 00 CD

Roll over from byte 8 and byte 9 happens when the below request is recieved:
AA 00 01 FF 01 01 00 88 FF FF 92 02 00 00 4D

Byte 4 (01) and byte 5 (01) are the address of the controller.
Byte 10 (92) is the table from which the data is required.
Byte 11 (02) is the lenght for the required data.
Byte 12 (00) is the offset for the required data in the table.

Would somebody please be so kind to, at least, give me a clue how to calculate byte 14, which I suppose is a CRC-8?

Every tip would be highly appreciated.

Thanks very much.
regregex
Preferred Member



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

Aug 03, 2013 7:59 pm

Hello Snotneus, welcome to the forums!

You're right, the checksum is a CRC and in fact is pretty uncomplicated:
Code:
C:\>reveng -w 8 -s 01FF010100880000920200004B 01FF01010088010092020000C8 01FF010
100880200920200004E 01FF01010088030092020000CD 01FF01010088FFFF920200004D
width=8  poly=0x81  init=0xff  refin=true  refout=true  xorout=0x00  check=0x76
 name=(none)
(Produced by CRC RevEng.)
(For an explanation of this parameter set, 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.)

NB: As CRC algorithms tend to use initial values of all 0s or all 1s, I tried skipping varying numbers of characters as 'headers' in case such an Init value appears. Here it does so when the 0xAA 0x00 characters are not checked.

I haven't seen this algorithm before. Do you know of any Satchwell documentation online that covers this algorithm in detail?

HTH

Greg
Snotneus
New User



Joined: 31 Jul 2013
Posts: 2


Aug 04, 2013 5:43 am

Hello regregex,

Thank you very much for this solution.
I also did try to get the calculation for the CRC with the help of RevEng, but did not have any success.
I am very pleased you took the time to examine my problem.

The controller MN500 is manufactured by Satchwell United Kingdom, nowadays owned by Schneider Electric.
I used to work for Satchwell over here in the Netherlands for a long time ago and thats why I have a few Satchwell controllers available.
During my Satchwell time I have asked for documentation about the Satchwell NCP protocol, but the only way to become a manual was to pay a lot of British pounds and sign a document of confirmation.
So I doubt there is any public documentation about this protocol available.
Anyway, I searched the Internet thoroughly many times, but could not find anything.

Thanks again for your time to figure this out.

Greetings from The Netherlands.

       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