Hi 
Anybody....
I am finding it difficult to generate crc5 as per USB 1.1
I have written this code for crc5 calculation for token data

typedef unsigned short  WORD;
WORD crc5(WORD f)
{
	WORD i,seed=0x1f,t=f,flag;

	for(i=0;i<11;i++)

	{
		flag=(t^seed)&1;
		seed>>=1;
		t>>=1;

		if(flag)
			seed^=0x14;
	}
	seed^=0x1f;

	return((f&0x7ff)|((seed&0x1f)<<11));
}

the result returned is not matching with the one in the Example as given in the www.USB.ORG site.. please help.
If u have another piece of code please pass it on..

( for ex.. for addr '15' and endp 'e' expected crc5 to be 0xa8f7)

You could contact me on ravi368@yahoo.com

Thanks
Ravi