CARLO GAVAZZI UDM 40 - PROGRAMMING Uživatelský manuál Strana 21

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 23
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 20
21
CARLO GAVAZZI
CONTROLS
SERIAL COMMUNICATION PROTOCOL
UDM - USC
V1 R1
Page
21
4 CRC CALCULATION ALGORITHM
CRC is calculated according to the relevant flow diagram (see below). An explanatory example will
follow.
Example 25: calculation of CRC starting from frame 0207h
NOTE: the byte 41h is sent first (even if it’s the LSB),
then byte 12h is sent.
CRC Inizialization
1111
1111
1111
1111
Load first byte 0000 0010
Execute XOR with the first byte of the frame 1111 1111 1111 1101
Execute 1st right Shift 0111 1111 1111 1110 1
Carry = 1 , load polynomial 1010 0000 0000 0001
Execute XOR with the polynomial 1101 1111 1111 1111
Execute 2nd right Shift 0110 1111 1111 1111 1
Carry = 1 , load polynomial 1010 0000 0000 0001
Execute XOR with the polynomial 1100 1111 1111 1110
Execute 3rd right Shift 0110 0111 1111 1111 0
Execute 4th right Shift 0011 0011 1111 1111 1
Carry = 1 , load polynomial 1010 0000 0000 0001
Execute XOR with the polynomial 1001 0011 1111 1110
Execute 5th right Shift 0100 1001 1111 1111 0
Execute 6th right Shift 0010 0100 1111 1111 1
Carry = 1 , load polynomial 1010 0000 0000 0001
Execute XOR with the polynomial 1000 0100 1111 1110
Execute 7th right Shift 0100 0010 0111 1111 0
Execute 8th right Shift 0010 0001 0011 1111 1
Carry = 1 , load polynomial 1010 0000 0000 0001
Execute XOR with the polynomial 1000 0001 0011 1110
Load the second byte of the frame 0000 0111
Execute XOR with the second byte of the frame 1000 0001 0011 1001
Execute 1st right Shift 0100 0000 1001 1100 1
Carry = 1 , load polynomial 1010 0000 0000 0001
Execute XOR with the polynomial 1110 0000 1001 1101
Execute 2nd right Shift 0111 0000 0100 1110 1
Carry = 1 , load polynomial 1010 0000 0000 0001
Execute XOR with the polynomial 1101 0000 0100 1111
Execute 3rd right Shift 0110 1000 0010 0111 1
Carry = 1 , load polynomial 1010 0000 0000 0001
Execute XOR with the polynomial 1100 1000 0010 0110
Execute 4th right Shift 0110 0100 0001 0011 0
Execute 5° right Shift 0011 0010 0000 1001 1
Carry = 1 , load polynomial 1010 0000 0000 0001
Execute XOR with the polynomial 1001 0010 0000 1000
Execute 6th right Shift 0100 1001 0000 0100 0
Execute 7th right Shift 0010 0100 1000 0010 0
Execute 8th right Shift 0001 0010 0100 0001 0
CRC Result 0001 0010 0100
0001
12h 41h
Hex FFFF = CRC
CRC xor BYTE = CRC
n = 0
CRC right shift
carry over
CRC xor POLY = CRC
n = n+1
n > 7
next BYTE
end message
End
yes
no
yes
no
no
yes
POLY = crc calculation polynominal: A001h
Zobrazit stránku 20
1 2 ... 16 17 18 19 20 21 22 23

Komentáře k této Příručce

Žádné komentáře