CRC Calulation
alanh
Posts: 30
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
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
0
Comments
AVlink HDMI 8x8 Matrix Switcher HX2388
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.
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.
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.