Computer Interfacing

# help for calcul CRC

help for calcul CRC

Author Message
Dimon1978pl
New User

Joined: 20 Sep 2013
Posts: 2
Location: Ukraine

 Sep 20, 2013 6:17 pm polynom x16 + x12 + x5 + 1 (FROM INSTRUCTION) FD 31 02 FE give CRC 23 C4 FD 32 02 FE give CRC 47 2B FD 43 4E 41 4C 05 FE give CRC E5 EC FD 43 52 45 53 05 FE give CRC 2B 92 FD 43 4E 41 4C 31 06 FE give CRC C1 09 what the algo thank you
supermathdude
Guest

 Sep 23, 2013 10:24 am algo is X53fFD.
Dimon1978pl
New User

Joined: 20 Sep 2013
Posts: 2
Location: Ukraine

Sep 24, 2013 11:05 am

 Quote: algo is X53fFD.

Can you explain?

The manual has a code in C + +,

unsigned int CountCRC16(void *mem, unsigned int len)
{
unsigned int a, crc16;
char *pch;
pch=(char *)mem;
crc16=0;
while(len--)
{
crc16^=*pch;
a=(crc16^(crc16<<4))&0x00FF;
crc16=(crc16>>8)^(a<<8)^(a<<3)^(a>>4);
pch+=1;
}
return(crc16);
}

unsigned int i,j;
j=CountCRC16F(usb,i);
memcpy(&usb[i],&j,2);

the program displays this:

FD 31 02 FE give CRC 0D 97 (need to get 23 C4)

 Page 1 of 1

Running on php BB © 2001, 2009 php BB Group