EmbDev.net

Forum: µC & Digital Electronics can't find the right CRC


Author: Gianni B. (gianni60)
Posted on:

Rate this post
0 useful
not useful
Hi,
I'm receiving some data from a serial port and I'm trying to understand 
the last byte witch kind of control it is but up to now I didn't find 
the answers.

These is the data stream of 8 messages:
Every message start with 0x02 (STX) and at the end there is the CRC(?) 
Byte
if inside the message there is a 0x02 a 0x00 is inserted (escape). This 
0x00 byte I have already eliminated

0x02 0x1D 0x11 0x6A 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00 
0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x67


0x02 0x26 0x13 0x79 0x4F 0x00 0x00 0x00 0x02 0x02 0x54 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x61


0x02 0x1D 0x11 0x6B 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00 
0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x68


0x02 0x26 0x14 0x7A 0x4F 0x00 0x00 0x00 0x02 0x00 0x44 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x17


0x02 0x1D 0x11 0x6C 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00 
0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x69


0x02 0x26 0x17 0x7A 0x4F 0x01 0x00 0x00 0x64 0x00 0xE1 0x00 0x00 0x00 
0x00 0x00 0x0D 0x01 0x01 0x00 0xFA 0x00 0xFA 0x01 0x90 0x01 0xB8 0x5A 
0x0F 0x00 0x64 0x27 0x10 0x00 0x0A 0x07 0xD0 0xB4


0x02 0x1D 0x11 0x6D 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00 
0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x6A


0x02 0x26 0x13 0x7A 0x4F 0x00 0x00 0x00 0x02 0x02 0x54 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x63

Anyone has some idea?

Regards

Gianni

Author: Pollux (Guest)
Posted on:

Rate this post
0 useful
not useful
Gianni B. wrote:

> 0x02 0x1D 0x11 0x6A 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00
> 0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> 0x67
>
> 0x02 0x1D 0x11 0x6B 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00
> 0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> 0x68
>
> 0x02 0x1D 0x11 0x6C 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00
> 0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> 0x69
>
> 0x02 0x1D 0x11 0x6D 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00
> 0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> 0x6A

If you look at the above messages, only the 4th byte is incremented by 
one, and the last byte counts up as well. Therefore it is less likely 
that the last byte is a CRC. To me it looks like a sum, but I can't yet 
tell you how it's calculated.

Author: Bevitore di Ramazzotti (Guest)
Posted on:

Rate this post
0 useful
not useful
http://reveng.sourceforge.net/
CRC RevEng: arbitrary-precision CRC calculator and algorithm finder

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig