Home AMX User Forum AMX General Discussion
Options

CRC Calulation

I am having a problem calculating the crc for a switcher, i used a web based calculator but it appears i am going wrong somewhere, the manual states
CRC calculation
CRC 0 = 0 (initial value)
CRC 1 = CRC_Table[CRC 0 ^ Byte 1] = CRC_Table[0x00 ^ 0x20] = 0x23;
CRC 2 = CRC_Table[CRC 1 ^ Byte 2] = CRC_Table[0x23 ^ 0x01] = 0x9F;
CRC 3 = CRC_Table[CRC 2 ^ Byte 3] = CRC_Table[0x9F ^ 0x06] = 0x8D;
CRC 4 = CRC_Table[CRC 3 ^ Byte 4] = CRC_Table[0x8D ^ 0x03] = 0x93;
Byte 5 = CRC 4;
CRC_Table : Please refer to Table 3-1 CRC Table.

i am sending SEND_STRING DV_HDMI_DESK_1,"$20,$01,$06,$03,$93" //input 3 to output 6
the above command works but the others don't as detailed below.

SEND_STRING DV_HDMI_DESK_1,"$20,$01,$01,$04,$56" //input 4-1
SEND_STRING DV_HDMI_DESK_1,"$20,$01,$01,$06,$79" //input6- output1
SEND_STRING DV_HDMI_DESK_1,"$20,$01,$02,$08,$C9" //input8-output2

Any help or advice would be greatly appreciated

Thanks

Comments

  • Options
    papadoukpapadouk Posts: 58
    Manufacturer? Model ?
  • Options
    alanhalanh Posts: 30
    Make & model

    AVlink HDMI 8x8 Matrix Switcher HX2388
  • Options
    papadoukpapadouk Posts: 58
    well, i cannot find a manual for the protocol in their web site.
    That manual is in the CD that is included in the package of the device.

    Check the CRC_Table array. If you find the values stored in this table the same with one of the Tables of common CRC algorithms then you can easily find some code in the internet that calculates it.
  • Options
    VasiliyVasiliy Posts: 13
    it is not possible to calculate the CRC without a manual.

    BUT, if you have the device which sends correct pakets (sequences) then you can try to restore the algorithm of CRC creation.

    As for my opinion, that manufacturer uses well-known algorithm: CLR,CRC8,CRC16,CRC32

    or

    a modification of the above-mentioned (just some numerical bias/shift is added)


    hope my experience will help you... :)

    let me please know your results.
  • Options
    jweatherjweather Posts: 320
    According to this calculator http://www.lammertbies.nl/comm/info/crc-calculation.html the first example is the low byte of a CRC-DNP calculation, but that doesn't match up with the other commands you posted -- are those also from the manual, or are they your own calculations?

    Either way, your best bet is probably going to be incorporating the CRC table from the manual, or finding a version online you can copy and paste. Or if you only have a few commands, just figure out the checksum in advance.
  • Options
    alanhalanh Posts: 30
    The manufactuer sent me an updated crc reference sheet and this solved the problem, thanks to everybody that replied.
  • Options
    VasiliyVasiliy Posts: 13
    welcome. pleasure to help.
Sign In or Register to comment.