sinee — 12.3.6CRC Parity

EM500 Open-Loop 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 ; [1]: N w +N r ≤16 ; 12.3.6CRC Parity CRC parity is with low byte in the front and the high byte in the back. Transmitting device calculates CRC value at first and attaches it in the sent message. Receiving device will, upon receipt of the CRC value, calculate it again and compare the calculated value with the received CRC value. If they are not equal, it means that an error has occurred in the 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 sent message, and the value of CRC register, and put the result into CRC register. This starts from the address code, without involving start bit and stop bit. (3) Draw and check LSB (the least significant bit of CRC register). (4) If LSB is 1, all bits of CRC register will be shifted rightward by one bit and the most significant bit will be supplemented by 0. Perform xor calculation for the value of CRC register and A001H, and put the results in CRC register. (5)If LSB is 0, all bits of CRC register will be shifted 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 the next byte of the sent message, until all bytes of the sent message are processed. (8) Calculation completed. The 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) { 398