| Author |
Message |
Silvia Guest
|
| May 15, 2008 3:47 am |
|
|
Hello
I canīt generate the correct CRC for this frame:
7E 21 45 00 00 40 00 07 00 00 40 11 A6 65 AC 1D BE 03 AC 1D BE 02 52 08 52 08 00 2C 69 FC 3E 52 54 58 20 48 4F 4C 41 3B 49 44 3D 30 31 32 33 34 35 3B 49 50 3D 31 37 32 2E 32 39 2E 31 39 30 2E 33 3C AE 9C 7E
The CRC is: AE9C, but I canīt generate it in your calculator.
what's the correct CRC for this frame?
please help me find how does this CRC code is generated, addressing a function and starting parameters..
Sincerely.
Sivia |
|
Silvia Guest
|
| May 21, 2008 4:58 pm |
|
|
Hello
Iīm a new user
Someone know what's the algorithm to calculate the reverse CRC16 ( polynomial 8408H ).
Sincerely.
Sivia |
|
regregex Full Member
Joined: 30 Oct 2007 Posts: 66 Location: London, UK
|
| May 30, 2008 2:35 pm |
|
|
Hello Silvia, welcome to the forum.
I wasn't able to find the algorithm used. Do you happen to have a smaller example?
Thanks
--Greg |
|
wolfe1337 Guest
|
| Aug 15, 2008 7:48 am |
|
|
hi
i suppose this is a hdlc frame. i have a smaller one.
| Quote: | 1 SNRM/UA frame exchange with HDLC parameter negotiation
Sent frame:
7E A00A000200232193 1871 7E |
I know that the checksum is 1871 .
The operation should be crc ccitt 16.
So the message is: A00A000200232193.
Then adding 4 Zeros.
And calculating 0xA00A0002002321930000 mod 0x1021 = 0xd26
what is the glue? |
|
wolfe1337 Guest
|
| Aug 15, 2008 9:04 am |
|
|
should i change the order of the bits?
and if in what way?
the msb is the first tranmitted.
03->110 0000
A = 1010 ->0101 =5
0 = 0000 ->0000 =0
0 = 0000 ->0000 =0
A = 1010 ->0101 =5
0 = 0000 ->0000 =0
0 = 0000 ->0000 =0
0 = 0000 ->0000 =0
2 = 0010 ->0100 =4
0 = 0000 ->0000 =0
0 = 0000 ->0000 =0
2 = 0010 ->0100 =4
3 = 0011 ->1100 =C
2 = 0010 ->0100 =4
1 = 0001 ->1000 =8
9 = 1001 ->1001 =9
3 = 0011 ->1100 =C
is my new string 50050004004c489c
or c984c40040005005 ?
do i have to reverse the result?
maybe the routine is like this:
do
mix_up any Bits quite chaotic
loop until checksum is korrekt |
|
Guest
|
| Aug 15, 2008 9:13 am |
|
|
i forgot to mention what is all about.
in the end it should be dlms over hdlc.
here i found a few examples for valid messages.
Imapropriate content removed by admin |
|
Guest Guest
|
| Aug 15, 2008 11:53 am |
|
|
Hi,
Silvia:
7E2145000040000700004011A665AC1DBE03AC1DBE0252085
208002C69FC3E52545820484F4C413B49443D303132333435
3B49503D3137322E32392E3139302E333CAE9C7E
wolfe1337:
A00A000200232193
Both are standard CRC-16/X-25:
| Code: |
poly : $1021;
init : $FFFF;
xorout : $FFFF;
check : $906E;
width : 16;
refin : true;
refout : true;
name : 'CRC-16/X-25';
alias : 'CRC-16/IBM-SDLC';
alias : 'CRC-16/ISO-HDLC'; |
Gammatester |
|
wolfe1337 Guest
|
| Aug 15, 2008 4:15 pm |
|
|
i set the settings you told.
the datasequence should be 0x123456789
this might be the datapaket for the result checksum 0x906E. the tool confirmed this.
the next step was to calculate the checksum for my datasequence 0xA00A000200232193.
The result was not 0x1871 but 0xFB08.
can someone please help me out?
Inapropriate content removed by admin |
|
Gammatester Guest
|
| Aug 15, 2008 7:43 pm |
|
|
Sorry but I think that you or the crc-tool did a mistake. I confirmed the CRC with Danjel McGougan's Universal_crc (see the code below). The original calculations were done with my implementation of the Rocksoft Model. (Sorry but I am not allowd to give URLs here by the forum software).
Please not that hex output "CRC=0x7118" is 16 bit format, you must change that byte order if you write it as a hex byte string: "0x18 0x71" which is your original crc.
Hope that helps
Gammatester
|
|
wolfe1337 Guest
|
| Aug 16, 2008 5:02 am |
|
|
| thanx you are the best. |
|
lammert Site Admin
Joined: 13 Mar 2007 Posts: 94 Location: Netherlands and Kazakhstan
|
| Aug 17, 2008 10:17 am |
|
|
| Quote: | | Sorry but I am not allowd to give URLs here by the forum software |
And you are also not allowed to post programming code of which you obviously don't own the intelectual property rights. It is not the forum software that blocks you from posting URLs, it is the result of a forum policy where the exchange of original and helpful information is more important than just copycatting what others have done. |
|
Guest
|
| Sep 19, 2008 3:06 pm |
|
|
| If it was from Danjel McGougan's universal_crc then the license must be GPL. |
|
lammert Site Admin
Joined: 13 Mar 2007 Posts: 94 Location: Netherlands and Kazakhstan
|
| Sep 19, 2008 5:39 pm |
|
|
| If it was GPL, parts of the source still can't be posted without restrictions. The viral rule of GPL tells that every copy or derivate must contain a copyright notice which mentions the original copyright holder. One of the silly rules of the not-so-free GPL. |
|
Guest
|
| Sep 19, 2008 6:22 pm |
|
|
| Danjel McGougan's Universal_crc IS GPL, but what I posted was a modified source code of the output of Universal_crc. And in this generated code there is no copyright or license hint, only the comment "Code generated by universal_crc by Danjel McGougan". So I think this is public domain. |
|