S12XD - Can any one help me in calculating this 11 bit CRC using the following algorithm

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S12XD - Can any one help me in calculating this 11 bit CRC using the following algorithm

1,682 Views
saurav99
Contributor I
Hai all,
           Can any one help me in calculating this 11 bit CRC using the following algorithm i think its little bit tricky.Can any one please tell me how to calculate the CRC by using this please tell me.I am giving the algorithm and all the data can any one reply.

The following pseudo code summarizes the CRC calculation algorithm:

vCrcReg(vCrcSize - 1 : 0) = vCrcInit; // Initialize the CRC register

while(vNextBit)

// determine if the CRC polynomial has to be applied by taking

// the exclusive OR of the most significant bit of the CRC register

// and the next bit to be fed into the register

vCrcNext = vNextBit EXOR vCrcReg(vCrcSize - 1);

// Shift the CRC register left by one bit

vCrcReg (vCrcSize - 1 : 1) = vCrcReg(vCrcSize - 2 : 0);

vCrcReg(0) = 0;

// Apply the CRC polynomial if necessary

if vCrcNext

vCrcReg(vCrcSize - 1 : 0) = vCrcReg(vCrcSize - 1 : 0) EXOR vCrcPolynomial;

end; // end if

end; // end while loop

parameters to be used in above algorithm

vCrcSize = cHCrcSize; // (= 11) size of the register is 11 bits

vCrcInit = cHCrcInit; // (= 0x1A) initialization vector of header

// CRC

vCrcPolynomial = cHCrcPolynomial; // (= 0x385) hexadecimal representation of

// the header CRC polynomial

Vnext bit is 00000000000100111111

Can any one please help me in calculating this and how to claculate it.

 

Thanks in advance,

 

Thanking you,

Bye,

saurav99.


--
Alban Edit: Please always include FSL Part Number in Message Subject line.

 

 

 

 


Message Edited by Alban on 2007-09-18 06:17 PM
Labels (1)
0 Kudos
3 Replies

428 Views
Lundin
Senior Contributor IV
And how is this related to Freescale 16-bit microcontrollers?
0 Kudos

428 Views
saurav99
Contributor I
Hai Lundin,
                  I am using Freescale MC9S12Xdp512 boards i have got this problem while calculating CRC for this while implementation so i wanted to find out how to calculate CRC using the given algorithm. so could you please help in finding it out or analysing or any code we can extract from this algorithm.
 
please help me in doing this.
 
Thanking you,
 
Bye,
saurav99.


--
Alban Edit: Please always include FSL Part Number in Message Subject line.



Message Edited by Alban on 2007-09-18 06:16 PM
0 Kudos

428 Views
Vy
Contributor I
Hi Saurav

I've figured out the CRC algorithm but don't get too excited.

The answers that i'm getting are not on expected lines.

Vy
0 Kudos