General Information
1.13 CRC Calculation (CHECKSUM for RTU)
ATC5300
Modbus Communication Protocol, Edition 03/2011, A5E02469001-02
15
Example of CRC calculation:
Frame = 0207h
CRC initialization
1111
1111
1111
1111
Load the first byte
0000
0010
Execute xor with the first
1111
1111
1111
1101
Byte of the frame
Execute 1
st
right shift
0111
1111
1111
1110
1
Carry=1, load polynominal
1010
0000
0000
0001
Execute xor with the polynominal
1101
1111
1111
1111
Execute 2
nd
right shift
0110
1111
1111
1111
1
Carry=1, load polynominal
1010
0000
0000
0001
Execute xor with the polynominal
1100
1111
1111
1110
Execute 3
rd
right shift
0110
0111
1111
1111
0
Execute 4
th
right shift
0011
0011
1111
1111
1
Carry=1, load polynominal
1010
0000
0000
0001
Execute xor with the polynominal
1001
0011
1111
1110
Execute 5
th
right shift
0100
1001
1111
1111
0
Execute 6
th
right shift
0010
0100
1111
1111
1
Carry=1, load polynominal
1010
0000
0000
0001
Execute xor with the polynominal
1000
0100
1111
1110
Execute 7
th
right shift
0100
0010
0111
1111
0
Execute 8
th
right shift
0010
0001
0011
1111
1
Carry=1, load polynominal
1010
0000
0000
0001
Load the second byte of the frame
0000
0111
Execute xor with the polynominal
1000
0001
0011
1001
Second byte of the frame
Execute 1
st
right shift
0100
0000
1001
1100
1
Carry=1, load polynominal
1010
0000
0000
0001
Execute xor with the polynominal
1110
0000
1001
1101
Execute 2
nd
right shift
0111
0000
0100
1110
1
Carry=1, load polynominal
1010
0000
0000
0001
Execute xor with the polynominal
1101
0000
0100
1111
Execute 3
rd
right shift
0110
1000
0010
0111
1
Carry=1, load polynominal
1010
0000
0000
0001
Execute xor with the polynominal
1100
1000
0010
0110
Execute 4
th
right shift
0110
0100
0001
0011
0
Execute 5
th
right shift
0010
0100
0000
1001
1
Carry=1, load polynominal
1010
0000
0000
0001
Execute xor with the polynominal
1001
0010
0000
1000
Execute 6
th
right shift
0100
1001
0000
0100
0
Execute 7
th
right shift
0010
0100
1000
0010
0