K12 CRC-CCITT

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

K12 CRC-CCITT

1,053 Views
walter_gallegos
Contributor I

Someone use the CRC module of K12 ?

I'm using the CRC-CCITT Processor Expert settings but result don't match.

Testing with "123456789" the CRC is 0x6856 when the expected is 0x29B1

Tags (1)
0 Kudos
4 Replies

586 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Walter,

You can refer the Typical Usage of Component CRC_LDD.

CRC-CCITT.jpg

Then I can get the result: 0x29B1

CRC-CCITT result.jpg

Best Regards,

Robin

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

586 Views
walter_gallegos
Contributor I

Hi Robin, thank you for answer.

Yes, I check block CRC work as expected but byte to byte apparently not.

pastedImage_5.png

pastedImage_1.png

First CRC is :  0x6856 

Second CRC is : 0x29b1   

Due firmware constraints we prefer use CRC_GetCRC16.

We can modify to process CRC as block but both CRC must be equal, correct ?

Best regards,

Walter

0 Kudos

586 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Walter,

If you want the CRC work byte to byte, you need use CRC1_GetCRC8.

GetCRC8.jpg

  CRC1_ResetCRC(DeviceData);

  for (i = 0; i < sizeof(dat)-1; i++) {

    crc = CRC1_GetCRC8(DeviceData,dat[i]);

  }

Best Regards,

Robin

0 Kudos

586 Views
walter_gallegos
Contributor I

Hi Robin,

Thank you for your support,

My apologies, I misunderstand the function name considering GetCRC16 as a CRC in 16 bits and not a CRC with 16 bit data.

So, to calc a CRC-CCITT byte to byte I need set up the CRC module for 16 bits with polynomial and seed in 16 bits but use the module calling GetCRC8.

Best regards,

Walter

0 Kudos