sinee — 12.3.6 CRC Parity

EM600 High-Performance Vector Control Inverter User Manual [4]: N r ≤16, indicates the number of registers requested to read; [5]: N w ≤16, indicates the number of registers requested to write; [6]: N w +N r ≤16; 12.3.6 CRC Parity CRC parity is with low byte in the front and high byte in the back. Transmitting device calculates CRC value at first and attaches this value in sent message. Receiving device will, upon receipt of CRC value, calculate it again and compare the calculated value with received CRC value. If they are not equal, it means that an error has occurred in transmitting process. Calculation of CRC parity: (1) Define a CRC register and assign an initial value FFFFH.

(2) Perform xor calculation for the first byte of the message to be sent, and value of CRC register, and put the result into CRC register. This starts from address code, without involving start bit and stop bit. (3) Draw and check LSB (least significant bit of CRC register). (4) If LSB is 1, all bits of CRC register will shift rightward by one bit and the most significant bit will be supplemented by 0. Perform xor calculation for CRC register value and A001H, and put the result in CRC register. (5) If LSB is 0, all bits of CRC register will shift rightward by one bit and the most significant bit will be supplemented by 0.

(6) Repeat steps 3, 4 and 5, until 8 times of shifts have been completed. (7) Repeat steps 2, 3, 4, 5 and 6, and process next byte of the message to be sent, until all bytes of the message are processed. (8) Calculation completed. Content of CRC register is the value for CRC parity. (9) In a system where time and resource are limited, better to use the look-up table method to realize CRC parity. CRC simple function is as follows (use C language for programming):

unsigned int CRC_Cal_Value(unsigned char *Data, unsigned char Length) { unsigned int crc_value = 0xFFFF; int i = 0; while(Length--) { crc_value ^= *Data++; for(i=0;i { if(crc_value & 0x0001) { crc_value = (crc_value>>1)^ 0xa001; } else { crc_value = crc_value>>1; } } } 264 42 (10) 9+2N [5] w 8 5 41