CRC Calculations


Closed Thread
Results 1 to 2 of 2
  1. #1
    timmers's Avatar
    timmers Guest

    Default CRC Calculations

    Trying to work out comms for the Maxon Motor controllers. We need to send a CRC code at the end of a frame. Anyone got any sugestions how to calculate this. Even my teenage kids don't get this one!

    Extract from data sheet:
    The algorithm used is CRC-CCITT. The CRC
    calculation includes all bytes of the frame. The data bytes have to be
    calculated as a word. At first you have to shift in the high byte of the data
    word. This is the opposite way you transmit the data word.
    The 16-bit generator polynomial
    ‘x16+x12+x5+1’ is used for the calculation.
    Packet M(x): WORD DataArray[n]
    Generator Polynom G(x): 10001000000100001 (= x16+x12+x5+x0)
    DataArray[0]: HighByte(OpCode) + LowByte(len-1);
    DataArray[1]: data[0]
    DataArray[2]: data[1]

    DataArray[n-1]: 0x0000 (ZeroWord)


    So in their example
    ReadObject ‘SoftwareVersion’ (Index = 0x2003, SubIndex = 0x01)
    OpCode len-1 data[0] data[1] CRC
    0x10 0x01 0x2003 0x0201 0xA888
    OpCode: 0x10 = ReadObject
    Len-1: 0x01 = 2 Words
    data[0]: 0x2003 = Index
    LowByte data[1]: 0x01 = SubIndex
    HighByte data[1]: 0x02 = Node-ID
    Transmission Order: 0x10,0x01,0x03,0x20,0x01,0x02,0x88,0xA8


    How did they calculate the CRC to be $A888
    Adding all the bytes up comes to $2215
    Any sugestions how to calculate the CRC most welcome.

    Tim.

  2. #2
    Join Date
    May 2009
    Location
    USA
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    I can't really follow the pseudo code written but what happens if you add the 2 byte "words"?
    Why is the email address verification case sensitive?

Similar Threads

  1. Dallas CRC8 Routines
    By Tom Estes in forum Code Examples
    Replies: 23
    Last Post: - 8th May 2018, 18:07
  2. CRC Calculator Routine
    By timmers in forum PBP Wish List
    Replies: 18
    Last Post: - 3rd May 2013, 17:44
  3. Calculating CRC for Modbus RTU
    By tekart in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 20th January 2010, 22:42
  4. Sensirion CRC
    By Tom Estes in forum Code Examples
    Replies: 3
    Last Post: - 9th November 2007, 15:09
  5. Problems with CRC8 Calc in 1Wire
    By JohnB in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th March 2007, 22:01

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts