In reply to chr_sue:
I’m getting compilation error for the above codes. If talked about the biggest value then theoretically it’ll be CRC 21 generator. Following is it’s code:
CRC_RG = 0; // initialize shift register
REPEAT
CRCNXT = NXTBIT EXOR CRC_RG(20);
CRC_RG(20:1) = CRC_RG(19:0); // shift left by 1 position
CRC_RG(0) = 0;
IF CRCNXT THEN
CRC_RG(20:0) = CRC_RG(20:0) EXOR (302899hex); ENDIF
UNTIL (CRC SEQUENCE starts or there is an ERROR condition)