Find out CRC or CHECKSUM of RS232 data

Posted by Carlos Alloatti on Stack Overflow See other posts from Stack Overflow or by Carlos Alloatti
Published on 2010-04-16T05:09:03Z Indexed on 2010/04/16 5:13 UTC
Read the original article Hit count: 500

I need to communicate with a RS232 device, I have no specs or information available.

I send a 16 byte command and get a 16 byte result back. The last byte looks like some kind of crc or checksum, I have tried using this http://miscel.dk/MiscEl/miscelCRCandChecksum.html with no luck.

Anyone can reverse engineer the crc/checksum algorithm? here is some data captured with an RS-232 monitor program:

01 80 42 00 00 00 00 00 00 00 00 00 00 00 01 B3
01 80 42 00 00 00 00 00 00 00 00 00 00 00 02 51
01 80 42 00 00 00 00 00 00 00 00 00 00 00 03 0F
01 80 42 00 00 00 00 00 00 00 00 00 00 00 04 8C
01 80 42 00 00 00 00 00 00 00 00 00 00 00 05 D2
01 80 42 00 00 00 00 00 00 00 00 00 00 00 06 30
01 80 42 00 00 00 00 00 00 00 00 00 00 00 07 6E
01 80 42 00 00 00 00 00 00 00 00 00 00 00 08 2F
01 80 42 00 00 00 00 00 00 00 00 00 00 00 09 71
01 80 42 00 00 00 00 00 00 00 00 00 00 00 0A 93
01 80 42 00 00 00 00 00 00 00 00 00 00 00 0B CD
01 80 42 00 00 00 00 00 00 00 00 00 00 00 0C 4E
01 80 42 00 00 00 00 00 00 00 00 00 00 00 0D 10
01 80 42 00 00 00 00 00 00 00 00 00 00 00 0E F2
01 80 42 00 00 00 00 00 00 00 00 00 00 00 0F AC
01 80 42 00 00 00 00 00 00 00 00 00 00 00 10 70
01 80 42 00 00 00 00 00 00 00 00 00 00 00 11 2E
01 80 42 00 00 00 00 00 00 00 00 00 00 00 12 CC
01 80 42 00 00 00 00 00 00 00 00 00 00 00 13 92
01 80 42 00 00 00 00 00 00 00 00 00 00 00 14 11
01 80 42 00 00 00 00 00 00 00 00 00 00 00 15 4F
01 80 42 00 00 00 00 00 00 00 00 00 00 00 16 AD
01 80 42 00 00 00 00 00 00 00 00 00 00 00 17 F3
01 80 42 00 00 00 00 00 00 00 00 00 00 00 18 B2
01 80 42 00 00 00 00 00 00 00 00 00 00 00 19 EC
01 80 42 00 00 00 00 00 00 00 00 00 00 00 1A 0E
01 80 42 00 00 00 00 00 00 00 00 00 00 00 1B 50
01 80 42 00 00 00 00 00 00 00 00 00 00 00 1C D3
01 80 42 00 00 00 00 00 00 00 00 00 00 00 1D 8D
01 80 42 00 00 00 00 00 00 00 00 00 00 00 1E 6F
01 80 42 00 00 00 00 00 00 00 00 00 00 00 1F 31
01 80 42 00 00 00 00 00 00 00 00 00 00 00 20 CE
01 80 42 00 00 00 00 00 00 00 00 00 00 00 21 90
01 80 42 00 00 00 00 00 00 00 00 00 00 00 22 72
01 80 42 00 00 00 00 00 00 00 00 00 00 00 23 2C
01 80 42 00 00 00 00 00 00 00 00 00 00 00 24 AF
01 80 42 00 00 00 00 00 00 00 00 00 00 00 25 F1
01 80 42 00 00 00 00 00 00 00 00 00 00 00 26 13
01 80 42 00 00 00 00 00 00 00 00 00 00 00 27 4D
01 80 42 00 00 00 00 00 00 00 00 00 00 00 28 0C
01 80 42 00 00 00 00 00 00 00 00 00 00 00 29 52
01 80 42 00 00 00 00 00 00 00 00 00 00 00 2A B0
01 80 42 00 00 00 00 00 00 00 00 00 00 00 2B EE
01 80 42 00 00 00 00 00 00 00 00 00 00 00 2C 6D
01 80 42 00 00 00 00 00 00 00 00 00 00 00 2D 33
01 80 42 00 00 00 00 00 00 00 00 00 00 00 2E D1
01 80 42 00 00 00 00 00 00 00 00 00 00 00 2F 8F
01 80 42 00 00 00 00 00 00 00 00 00 00 00 30 53
01 80 42 00 00 00 00 00 00 00 00 00 00 00 31 0D
01 80 42 00 00 00 00 00 00 00 00 00 00 00 32 EF
01 80 42 00 00 00 00 00 00 00 00 00 00 00 33 B1
01 80 42 00 00 00 00 00 00 00 00 00 00 00 34 32
01 80 42 00 00 00 00 00 00 00 00 00 00 00 35 6C
01 80 42 00 00 00 00 00 00 00 00 00 00 00 36 8E
01 80 42 00 00 00 00 00 00 00 00 00 00 00 37 D0
01 80 42 00 00 00 00 00 00 00 00 00 00 00 38 91
01 80 42 00 00 00 00 00 00 00 00 00 00 00 39 CF
01 80 42 00 00 00 00 00 00 00 00 00 00 00 3A 2D
01 80 42 00 00 00 00 00 00 00 00 00 00 00 3B 73
01 80 42 00 00 00 00 00 00 00 00 00 00 00 3C F0
01 80 42 00 00 00 00 00 00 00 00 00 00 00 3D AE
01 80 42 00 00 00 00 00 00 00 00 00 00 00 3E 4C
01 80 42 00 00 00 00 00 00 00 00 00 00 00 3F 12
01 80 42 00 00 00 00 00 00 00 00 00 00 00 40 AB
01 80 42 00 00 00 00 00 00 00 00 00 00 00 41 F5
01 80 42 00 00 00 00 00 00 00 00 00 00 00 42 17
01 80 42 00 00 00 00 00 00 00 00 00 00 00 43 49
01 80 42 00 00 00 00 00 00 00 00 00 00 00 44 CA
01 80 42 00 00 00 00 00 00 00 00 00 00 00 45 94
01 80 42 00 00 00 00 00 00 00 00 00 00 00 46 76
01 80 42 00 00 00 00 00 00 00 00 00 00 00 47 28
01 80 42 00 00 00 00 00 00 00 00 00 00 00 48 69
01 80 42 00 00 00 00 00 00 00 00 00 00 00 49 37
01 80 42 00 00 00 00 00 00 00 00 00 00 00 4A D5
01 80 42 00 00 00 00 00 00 00 00 00 00 00 4B 8B
01 80 42 00 00 00 00 00 00 00 00 00 00 00 4C 08
01 80 42 00 00 00 00 00 00 00 00 00 00 00 4D 56
01 80 42 00 00 00 00 00 00 00 00 00 00 00 4E B4
01 80 42 00 00 00 00 00 00 00 00 00 00 00 4F EA
01 80 42 00 00 00 00 00 00 00 00 00 00 00 50 36
01 80 42 00 00 00 00 00 00 00 00 00 00 00 51 68
01 80 42 00 00 00 00 00 00 00 00 00 00 00 52 8A
01 80 42 00 00 00 00 00 00 00 00 00 00 00 53 D4
01 80 42 00 00 00 00 00 00 00 00 00 00 00 54 57
01 80 42 00 00 00 00 00 00 00 00 00 00 00 55 09
01 80 42 00 00 00 00 00 00 00 00 00 00 00 56 EB
01 80 42 00 00 00 00 00 00 00 00 00 00 00 57 B5
01 80 42 00 00 00 00 00 00 00 00 00 00 00 58 F4
01 80 42 00 00 00 00 00 00 00 00 00 00 00 59 AA
01 80 42 00 00 00 00 00 00 00 00 00 00 00 5A 48
01 80 42 00 00 00 00 00 00 00 00 00 00 00 5B 16
01 80 42 00 00 00 00 00 00 00 00 00 00 00 5C 95
01 80 42 00 00 00 00 00 00 00 00 00 00 00 5D CB
01 80 42 00 00 00 00 00 00 00 00 00 00 00 5E 29
01 80 42 00 00 00 00 00 00 00 00 00 00 00 5F 77
01 80 42 00 00 00 00 00 00 00 00 00 00 00 60 88
01 80 42 00 00 00 00 00 00 00 00 00 00 00 61 D6
01 80 42 00 00 00 00 00 00 00 00 00 00 00 62 34
01 80 42 00 00 00 00 00 00 00 00 00 00 00 63 6A
01 80 42 00 00 00 00 00 00 00 00 00 00 00 64 E9
01 80 42 00 00 00 00 00 00 00 00 00 00 00 65 B7
01 80 42 00 00 00 00 00 00 00 00 00 00 00 66 55
01 80 42 00 00 00 00 00 00 00 00 00 00 00 67 0B
01 80 42 00 00 00 00 00 00 00 00 00 00 00 68 4A
01 80 42 00 00 00 00 00 00 00 00 00 00 00 69 14
01 80 42 00 00 00 00 00 00 00 00 00 00 00 6A F6
01 80 42 00 00 00 00 00 00 00 00 00 00 00 6B A8
01 80 42 00 00 00 00 00 00 00 00 00 00 00 6C 2B
01 80 42 00 00 00 00 00 00 00 00 00 00 00 6D 75
01 80 42 00 00 00 00 00 00 00 00 00 00 00 6E 97
01 80 42 00 00 00 00 00 00 00 00 00 00 00 6F C9
01 80 42 00 00 00 00 00 00 00 00 00 00 00 70 15
01 80 42 00 00 00 00 00 00 00 00 00 00 00 71 4B
01 80 42 00 00 00 00 00 00 00 00 00 00 00 72 A9
01 80 42 00 00 00 00 00 00 00 00 00 00 00 73 F7
01 80 42 00 00 00 00 00 00 00 00 00 00 00 74 74
01 80 42 00 00 00 00 00 00 00 00 00 00 00 75 2A
01 80 42 00 00 00 00 00 00 00 00 00 00 00 76 C8
01 80 42 00 00 00 00 00 00 00 00 00 00 00 77 96
01 80 42 00 00 00 00 00 00 00 00 00 00 00 78 D7
01 80 42 00 00 00 00 00 00 00 00 00 00 00 79 89
01 80 42 00 00 00 00 00 00 00 00 00 00 00 7A 6B
01 80 42 00 00 00 00 00 00 00 00 00 00 00 7B 35
01 80 42 00 00 00 00 00 00 00 00 00 00 00 7C B6
01 80 42 00 00 00 00 00 00 00 00 00 00 00 7D E8
01 80 42 00 00 00 00 00 00 00 00 00 00 00 7E 0A
01 80 42 00 00 00 00 00 00 00 00 00 00 00 7F 54
01 80 42 00 00 00 00 00 00 00 00 00 00 00 80 61
01 80 42 00 00 00 00 00 00 00 00 00 00 00 81 3F
01 80 42 00 00 00 00 00 00 00 00 00 00 00 82 DD
01 80 42 00 00 00 00 00 00 00 00 00 00 00 83 83
01 80 42 00 00 00 00 00 00 00 00 00 00 00 84 00
01 80 42 00 00 00 00 00 00 00 00 00 00 00 85 5E
01 80 42 00 00 00 00 00 00 00 00 00 00 00 86 BC
01 80 42 00 00 00 00 00 00 00 00 00 00 00 87 E2
01 80 42 00 00 00 00 00 00 00 00 00 00 00 88 A3
01 80 42 00 00 00 00 00 00 00 00 00 00 00 89 FD
01 80 42 00 00 00 00 00 00 00 00 00 00 00 8A 1F
01 80 42 00 00 00 00 00 00 00 00 00 00 00 8B 41
01 80 42 00 00 00 00 00 00 00 00 00 00 00 8C C2
01 80 42 00 00 00 00 00 00 00 00 00 00 00 8D 9C
01 80 42 00 00 00 00 00 00 00 00 00 00 00 8E 7E
01 80 42 00 00 00 00 00 00 00 00 00 00 00 8F 20
01 80 42 00 00 00 00 00 00 00 00 00 00 00 90 FC
01 80 42 00 00 00 00 00 00 00 00 00 00 00 91 A2
01 80 42 00 00 00 00 00 00 00 00 00 00 00 92 40
01 80 42 00 00 00 00 00 00 00 00 00 00 00 93 1E
01 80 42 00 00 00 00 00 00 00 00 00 00 00 94 9D
01 80 42 00 00 00 00 00 00 00 00 00 00 00 95 C3
01 80 42 00 00 00 00 00 00 00 00 00 00 00 96 21
01 80 42 00 00 00 00 00 00 00 00 00 00 00 97 7F
01 80 42 00 00 00 00 00 00 00 00 00 00 00 98 3E
01 80 42 00 00 00 00 00 00 00 00 00 00 00 99 60
01 80 42 00 00 00 00 00 00 00 00 00 00 00 9A 82
01 80 42 00 00 00 00 00 00 00 00 00 00 00 9B DC
01 80 42 00 00 00 00 00 00 00 00 00 00 00 9C 5F
01 80 42 00 00 00 00 00 00 00 00 00 00 00 9D 01
01 80 42 00 00 00 00 00 00 00 00 00 00 00 9E E3
01 80 42 00 00 00 00 00 00 00 00 00 00 00 9F BD
01 80 42 00 00 00 00 00 00 00 00 00 00 00 A0 42
01 80 42 00 00 00 00 00 00 00 00 00 00 00 A1 1C
01 80 42 00 00 00 00 00 00 00 00 00 00 00 A2 FE
01 80 42 00 00 00 00 00 00 00 00 00 00 00 A3 A0
01 80 42 00 00 00 00 00 00 00 00 00 00 00 A4 23
01 80 42 00 00 00 00 00 00 00 00 00 00 00 A5 7D
01 80 42 00 00 00 00 00 00 00 00 00 00 00 A6 9F
01 80 42 00 00 00 00 00 00 00 00 00 00 00 A7 C1
01 80 42 00 00 00 00 00 00 00 00 00 00 00 A8 80
01 80 42 00 00 00 00 00 00 00 00 00 00 00 A9 DE
01 80 42 00 00 00 00 00 00 00 00 00 00 00 AA 3C
01 80 42 00 00 00 00 00 00 00 00 00 00 00 AB 62
01 80 42 00 00 00 00 00 00 00 00 00 00 00 AC E1
01 80 42 00 00 00 00 00 00 00 00 00 00 00 AD BF
01 80 42 00 00 00 00 00 00 00 00 00 00 00 AE 5D
01 80 42 00 00 00 00 00 00 00 00 00 00 00 AF 03
01 80 42 00 00 00 00 00 00 00 00 00 00 00 B0 DF
01 80 42 00 00 00 00 00 00 00 00 00 00 00 B1 81
01 80 42 00 00 00 00 00 00 00 00 00 00 00 B2 63
01 80 42 00 00 00 00 00 00 00 00 00 00 00 B3 3D
01 80 42 00 00 00 00 00 00 00 00 00 00 00 B4 BE
01 80 42 00 00 00 00 00 00 00 00 00 00 00 B5 E0
01 80 42 00 00 00 00 00 00 00 00 00 00 00 B6 02
01 80 42 00 00 00 00 00 00 00 00 00 00 00 B7 5C
01 80 42 00 00 00 00 00 00 00 00 00 00 00 B8 1D
01 80 42 00 00 00 00 00 00 00 00 00 00 00 B9 43
01 80 42 00 00 00 00 00 00 00 00 00 00 00 BA A1
01 80 42 00 00 00 00 00 00 00 00 00 00 00 BB FF
01 80 42 00 00 00 00 00 00 00 00 00 00 00 BC 7C
01 80 42 00 00 00 00 00 00 00 00 00 00 00 BD 22
01 80 42 00 00 00 00 00 00 00 00 00 00 00 BE C0
01 80 42 00 00 00 00 00 00 00 00 00 00 00 BF 9E
01 80 42 00 00 00 00 00 00 00 00 00 00 00 C0 27
01 80 42 00 00 00 00 00 00 00 00 00 00 00 C1 79
01 80 42 00 00 00 00 00 00 00 00 00 00 00 C2 9B
01 80 42 00 00 00 00 00 00 00 00 00 00 00 C3 C5
01 80 42 00 00 00 00 00 00 00 00 00 00 00 C4 46
01 80 42 00 00 00 00 00 00 00 00 00 00 00 C5 18
01 80 42 00 00 00 00 00 00 00 00 00 00 00 C6 FA
01 80 42 00 00 00 00 00 00 00 00 00 00 00 C7 A4
01 80 42 00 00 00 00 00 00 00 00 00 00 00 C8 E5
01 80 42 00 00 00 00 00 00 00 00 00 00 00 C9 BB
01 80 42 00 00 00 00 00 00 00 00 00 00 00 CA 59
01 80 42 00 00 00 00 00 00 00 00 00 00 00 CB 07
01 80 42 00 00 00 00 00 00 00 00 00 00 00 CC 84
01 80 42 00 00 00 00 00 00 00 00 00 00 00 CD DA
01 80 42 00 00 00 00 00 00 00 00 00 00 00 CE 38
01 80 42 00 00 00 00 00 00 00 00 00 00 00 CF 66
01 80 42 00 00 00 00 00 00 00 00 00 00 00 D0 BA
01 80 42 00 00 00 00 00 00 00 00 00 00 00 D1 E4
01 80 42 00 00 00 00 00 00 00 00 00 00 00 D2 06
01 80 42 00 00 00 00 00 00 00 00 00 00 00 D3 58
01 80 42 00 00 00 00 00 00 00 00 00 00 00 D4 DB
01 80 42 00 00 00 00 00 00 00 00 00 00 00 D5 85
01 80 42 00 00 00 00 00 00 00 00 00 00 00 D6 67
01 80 42 00 00 00 00 00 00 00 00 00 00 00 D7 39
01 80 42 00 00 00 00 00 00 00 00 00 00 00 D8 78
01 80 42 00 00 00 00 00 00 00 00 00 00 00 D9 26
01 80 42 00 00 00 00 00 00 00 00 00 00 00 DA C4
01 80 42 00 00 00 00 00 00 00 00 00 00 00 DB 9A
01 80 42 00 00 00 00 00 00 00 00 00 00 00 DC 19
01 80 42 00 00 00 00 00 00 00 00 00 00 00 DD 47
01 80 42 00 00 00 00 00 00 00 00 00 00 00 DE A5
01 80 42 00 00 00 00 00 00 00 00 00 00 00 DF FB
01 80 42 00 00 00 00 00 00 00 00 00 00 00 E0 04
01 80 42 00 00 00 00 00 00 00 00 00 00 00 E1 5A
01 80 42 00 00 00 00 00 00 00 00 00 00 00 E2 B8
01 80 42 00 00 00 00 00 00 00 00 00 00 00 E3 E6
01 80 42 00 00 00 00 00 00 00 00 00 00 00 E4 65
01 80 42 00 00 00 00 00 00 00 00 00 00 00 E5 3B
01 80 42 00 00 00 00 00 00 00 00 00 00 00 E6 D9
01 80 42 00 00 00 00 00 00 00 00 00 00 00 E7 87
01 80 42 00 00 00 00 00 00 00 00 00 00 00 E8 C6
01 80 42 00 00 00 00 00 00 00 00 00 00 00 E9 98
01 80 42 00 00 00 00 00 00 00 00 00 00 00 EA 7A
01 80 42 00 00 00 00 00 00 00 00 00 00 00 EB 24
01 80 42 00 00 00 00 00 00 00 00 00 00 00 EC A7
01 80 42 00 00 00 00 00 00 00 00 00 00 00 ED F9
01 80 42 00 00 00 00 00 00 00 00 00 00 00 EE 1B
01 80 42 00 00 00 00 00 00 00 00 00 00 00 EF 45
01 80 42 00 00 00 00 00 00 00 00 00 00 00 F0 99
01 80 42 00 00 00 00 00 00 00 00 00 00 00 F1 C7
01 80 42 00 00 00 00 00 00 00 00 00 00 00 F2 25
01 80 42 00 00 00 00 00 00 00 00 00 00 00 F3 7B
01 80 42 00 00 00 00 00 00 00 00 00 00 00 F4 F8
01 80 42 00 00 00 00 00 00 00 00 00 00 00 F5 A6
01 80 42 00 00 00 00 00 00 00 00 00 00 00 F6 44
01 80 42 00 00 00 00 00 00 00 00 00 00 00 F7 1A
01 80 42 00 00 00 00 00 00 00 00 00 00 00 F8 5B
01 80 42 00 00 00 00 00 00 00 00 00 00 00 F9 05
01 80 42 00 00 00 00 00 00 00 00 00 00 00 FA E7
01 80 42 00 00 00 00 00 00 00 00 00 00 00 FB B9
01 80 42 00 00 00 00 00 00 00 00 00 00 00 FC 3A
01 80 42 00 00 00 00 00 00 00 00 00 00 00 FD 64
01 80 42 00 00 00 00 00 00 00 00 00 00 00 FE 86
01 80 42 00 00 00 00 00 00 00 00 00 00 00 FF D8

The second to last byte seems to be a sequential number that starts over at 00 when it reaches FF. I have included the whole range from 00 to FF to make it easier to guess the crc/checksum method.

© Stack Overflow or respective owner

Related posts about rs232

Related posts about crc