-
Notifications
You must be signed in to change notification settings - Fork 3
CRC
The description of the CRC used by Motion Control Bus protocol is:
Parameter | Value |
---|---|
Width | 16 bits |
Polynomial | 0x1021 |
Seed | 0x0000 |
It is commonly known as CRC-CCITT "XMODEM". During CRC development it is recommended to use this online tool for validation:
https://www.lammertbies.nl/comm/info/crc-calculation
Header | Config data | CRC |
---|---|---|
0x0204 | 0x86A0000100000000 | 0xA2C7 |
The library supports three strategies for CRC implementation:
- Pure software
- By software with hardware support
- Pure hardware
This library support all of them.
It is the default method (Mcb_IntfComputeCrc) available on the mcb_usr.c file. This strategy doesn't require any additional implementation from the user.
If the platform has hardware accelerators for the CRC calculation, the function Mcb_IntfComputeCrc may be overwritten by the user because it is declared as weak.
If the device is able to compute automatically the CRC at the end of the SPI transfer, the function Mcb_IntfComputeCrc may be disabled by setting the parameter bCalcCrc as false during the initialization of the MCB instance.