EM500 Open-Loop Vector Control Inverter User Manual
411
0x9C,0x5C,0x5D,0x9D,0x5F,0x9F,0x9E,0x5E,0x5A,0x9A,0x9B,0x5B,0x99,0x59,0x58,0x98,
0x88,0x48,0x49,0x89,0x4B,0x8B,0x8A,0x4A,0x4E,0x8E,0x8F,0x4F,0x8D,0x4D,0x4C,0x8C,
0x44,0x84,0x85,0x45,0x87,0x47,0x46,0x86,0x82,0x42,0x43,0x83,0x41,0x81,0x80,0x40
};
Uint16CRC(Uint8 * buffer, Uint8 crc_len)
{
Uint8 crc_i,crc_lsb,crc_msb;
Uint16 crc;
crc_msb = 0xFF;
crc_lsb = 0xFF;
while(crc_len--)
{
crc_i = crc_lsb ^ *buffer;
buffer ++;
crc_lsb = crc_msb ^ crc_l_tab[crc_i];
crc_msb = crc_h_tab[crc_i];
}
crc = crc_msb;
crc = (crc << 8) + crc_lsb;
return crc;
}
CRC16 look-up table for 16-bit processor: the finally returned result of this
program is with high byte in the front, so please reverse it while sending.)
const Uint16 crc_table[256] = {
0x0000,0xC1C0,0x81C1,0x4001,0x01C3,0xC003,0x8002,0x41C2,0x01C6,0xC006
,0x8007,0x41C7,0x0005,0xC1C5,0x81C4,0x4004,0x01CC,0xC00C,0x800D,0x41CD
,0x000F,0xC1CF,0x81CE,0x400E,0x000A,0xC1CA,0x81CB,0x400B,0x01C9,0xC009
,0x8008,0x41C8,0x01D8,0xC018,0x8019,0x41D9,0x001B,0xC1DB,0x81DA,0x401A
,0x001E,0xC1DE,0x81DF,0x401F,0x01DD,0xC01D,0x801C,0x41DC,0x0014,0xC1D4