フィルターのクリア

Help with Generation of CRC4

11 ビュー (過去 30 日間)
Sandra
Sandra 2023 年 6 月 16 日
編集済み: Sugandhi 2023 年 10 月 3 日
I am trying to generate a crc4 for a CAN message - I had some Matlab code I'd previously used for crc8 and changed it to use nibbles instead of bytes, see code attached. But I do not get the same result as received in the client CAN log. They have directed me to :
I have tried altering it several ways (count down in bits instead of up, use Reverse Polynomal (0xC8) but still cannot get the same answer.
Help much appreciated.

回答 (1 件)

Sugandhi
Sugandhi 2023 年 9 月 18 日
編集済み: Sugandhi 2023 年 10 月 3 日
Hi Sandra,
I understand that you are trying to generate a CRC4 for a CAN message, and you have modified CRC8 to use nibbles instead of bytes. But cannot get same result as received in the client CAN log.
The reason for the issue could be due to using the wrong polynomial for the CRC4 calculation. The polynomial you are using is 0x13, which is not the standard polynomial for CRC4. The standard polynomial for CRC4 is 0b10011.
  1 件のコメント
Sandra
Sandra 2023 年 10 月 3 日
Hi - your reply is confusing!
Standard Polynominal is 0x13 (ie hexidecimal), which in binary is 0b10011

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInstall Products についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by