器件型号: MSP430FR2355
我在使 CRC 模块正常工作时遇到问题。 我不需要代码审核、只是 CRC 的一个实际示例、它会为其实现的任何协议返回有效校验值(CRCing “123456789"的“的结果的结果,不带空终止符)。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
器件型号: MSP430FR2355
我在使 CRC 模块正常工作时遇到问题。 我不需要代码审核、只是 CRC 的一个实际示例、它会为其实现的任何协议返回有效校验值(CRCing “123456789"的“的结果的结果,不带空终止符)。
很久以前,有一次,我创建了三种方式的代码。 借助此实用标题:
/* CRC routines. Some MSP430 devices have CRC hardware to help. That hardware produces results identical to this only if the data is written to the reverse bit order input register CRCDIRB. Results are in the normal bit order register CRCINIRES. Go figure. Two versions are available to trade space for time. The iterative and slower version is the default but a faster table version is used if CRCTABLE is defined. That requires a large (512 bytes) table. When compiled with "msp430-gcc -c -O2" the code size is: Table: 592 Iterative: 120 Hardware: 44 If the target device has the CRC hardware then that is used. If the hardware is used the crc parameteris ignored. When hardware support is available all this file provides is the routine to process a string of data. If that isn't required, just use crc16.h and the macros will do the work. When tested with the usual test string of "123456789" all versions return 0x29B1. */
为了进行记录、Greg Cook 提供了一组 CRC 算法列表、其结果为“123456789",“,因此、因此您可以查看算法基于生成的校验和执行的操作