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
Hi Walter,
You can refer the Typical Usage of Component CRC_LDD.
Then I can get the result: 0x29B1
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Robin, thank you for answer.
Yes, I check block CRC work as expected but byte to byte apparently not.
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
Hi Walter,
If you want the CRC work byte to byte, you need use CRC1_GetCRC8.
CRC1_ResetCRC(DeviceData);
for (i = 0; i < sizeof(dat)-1; i++) {
crc = CRC1_GetCRC8(DeviceData,dat[i]);
}
Best Regards,
Robin
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