thank you for your great work. I tried to use your library to calculate a CRC for MODBUS use. However, when I compare the output of your library for FastCRC16 MODBUS with the CRC Calculator https://crccalc.com/, then the output doesn´t match.
For other CRC methods, the outputs are identical.
For example belowmodified example of yours delivers "0x25B4" as a result, while CRCCalc delivers "0x2590". REsults in case of KERMIT or CCITT are identical for your library and CRCCalc. Is there anything I do wrong, or is there an issue with the library?
/
FastCRC-Example
(c) Frank Boesing 2014
/
include
include
FastCRC16 CRC16;
uint8_t buf[5] = {0x12, 0x34, 0x56, 0x78, 0x09 };
void setup() {
delay(1500);
Serial.begin(115200);
Serial.println("CRC Example");
Serial.println();
Serial.print("MODBUS-CRC of \"");
for (unsigned int i = 0; i < sizeof(buf); i++) {
Serial.print((char) buf[i]);
}
Serial.print("\" is: 0x");
Serial.println( CRC16.modbus_upd(buf, sizeof(buf)), HEX );
Dear Frank,
thank you for your great work. I tried to use your library to calculate a CRC for MODBUS use. However, when I compare the output of your library for FastCRC16 MODBUS with the CRC Calculator https://crccalc.com/, then the output doesn´t match. For other CRC methods, the outputs are identical.
For example belowmodified example of yours delivers "0x25B4" as a result, while CRCCalc delivers "0x2590". REsults in case of KERMIT or CCITT are identical for your library and CRCCalc. Is there anything I do wrong, or is there an issue with the library?
/ FastCRC-Example (c) Frank Boesing 2014 /
include
include
FastCRC16 CRC16;
uint8_t buf[5] = {0x12, 0x34, 0x56, 0x78, 0x09 };
void setup() {
delay(1500); Serial.begin(115200);
Serial.println("CRC Example"); Serial.println();
Serial.print("MODBUS-CRC of \"");
for (unsigned int i = 0; i < sizeof(buf); i++) { Serial.print((char) buf[i]); }
Serial.print("\" is: 0x"); Serial.println( CRC16.modbus_upd(buf, sizeof(buf)), HEX );
}
void loop() { }
Thanks for checking, Holger