Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. 32 bit crc calculation for a sensor

32 bit crc calculation for a sensor

Scheduled Pinned Locked Moved C / C++ / MFC
helpiotalgorithmstoolsregex
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yagokhan
    wrote on last edited by
    #1

    Hi, I am trying to communicate with a sensor that sends 38bytes of data with 32 bit CRC with a polynomial ('04C11DB7'). I am using a pre-built table to drive the crc algorithm. I could not match the sender and receiver check for the error detection. Can you help me with these. I am sending matlab script about this below (It is almost the same as c code)

    clc
    clear all

    % % Tablo Olusturuldu
    % div=hex2dec('04C11DB7');

    %aye = n
    %c = rem
    % div=bitshift(div,31);
    div=hex2dec('04C11DB7');
    itshift(rem,-8);

    crcLookupTable2 = [hex2dec('00000000'), hex2dec('04c11db7'), hex2dec('09823b6e'), hex2dec('0d4326d9'),...
    hex2dec('130476dc'), hex2dec('17c56b6b'), hex2dec('1a864db2'), hex2dec('1e475005'),...
    hex2dec('2608edb8'), hex2dec('22c9f00f'), hex2dec('2f8ad6d6'), hex2dec('2b4bcb61'),...
    hex2dec('350c9b64'), hex2dec('31cd86d3'), hex2dec('3c8ea00a'), hex2dec('384fbdbd'),...
    hex2dec('4c11db70'), hex2dec('48d0c6c7'), hex2dec('4593e01e'), hex2dec('4152fda9'),...
    hex2dec('5f15adac'), hex2dec('5bd4b01b'), hex2dec('569796c2'), hex2dec('52568b75'),...
    hex2dec('6a1936c8'), hex2dec('6ed82b7f'), hex2dec('639b0da6'), hex2dec('675a1011'),...
    hex2dec('791d4014'), hex2dec('7ddc5da3'), hex2dec('709f7b7a'), hex2dec('745e66cd'),...
    hex2dec('9823b6e0'), hex2dec('9ce2ab57'), hex2dec('91a18d8e'), hex2dec('95609039'),...
    hex2dec('8b27c03c'), hex2dec('8fe6dd8b'), hex2dec('82a5fb52'), hex2dec('8664e6e5'),...
    hex2dec('be2b5b58'), hex2dec('baea46ef'), hex2dec('b7a96036'), hex2dec('b3687d81'),...
    hex2dec('ad2f2d84'), hex2dec('a9ee3033'), hex2dec('a4ad16ea'), hex2dec('a06c0b5d'),...
    hex2dec('d4326d90'), hex2dec('d0f37027'), hex2dec('ddb056fe'), hex2dec('d9714b49'),...
    hex2dec('c7361b4c'), hex2dec('c3f706fb'), hex2dec('ceb42022'), hex2dec('ca753d95'),...
    hex2dec('f23a8028'), hex2dec('f6fb9d9f'), hex2dec('fbb8bb46'), hex2dec('ff79a6f1'),...
    hex2dec('e13ef6f4'), hex2dec('e5ffeb43'), hex2dec('e8bccd9a'), hex2dec('ec7dd02d'),...
    hex2dec('34867077'), hex2dec('30476dc0'), hex2dec('3d044b19'), hex2dec('39c556ae'),...
    hex2dec('278206ab'), hex2dec('23431b1c'), hex2dec('2e003dc5'), hex2dec('2ac12072'),...
    hex2dec('128e9dcf'), hex2dec('164f8078'), hex2dec('1b0ca6a1'), hex2dec('1fcdbb16'),...
    hex2dec('018aeb13'), hex2dec('054bf6a4'), hex2dec('0808d07d'), hex2dec('0cc9cdca'),...
    hex2dec('7897ab07'), hex2dec('7c56b6b0'), hex2dec('71159069'), hex2dec('75d48dde'),...
    hex2dec('6b93dddb'), hex2dec('6f52c06c'), hex2dec('6211e6b5'), hex2dec('66d0fb02'),...
    hex2dec('5e9f46bf'), hex2d

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups