User guide

10 HDMI5 Component Video Switch
Checksums and CRC-8 Checkcodes Defi ned
The use of a checksums or CRC-8 checkcodes can increase the reliability of communications
between the controller and any Zektor device.
A checksum is calculated by using an unsigned byte as an accumulator, and adding together all
the ASCII characters of a command string, up to and including the ‘;’ character, while ignoring
any overfl ow, and appending it as a decimal parameter to the end of the command.
A CRC-8 checkcode is calculated in a very similar way, but a CRC-8 algorithm is used instead of
a simply adding together the ASCII characters. The CRC-8 byte is initialized to ‘FF’ hex, and the
resultant value is sent inverted (one's compliment).
The CRC polynomial used is: x^8 +x^6 +x^3 +x^2 +1.
This polynomial was determined through exhaustive tests (all 8 bit polynomials tested), to be the
best CRC-8 polynomial for arbitrarily length bit streams.
See paper entitled: “Cyclic Redundancy Code (CRC) Polynomial Selection For Embedded
Networks” by Philip Koopman & Tridib Chakravarty. <http://www.ece.cmu.edu/~koopman/roses/
dsn04/koopman04_crc_poly_embedded.pdf>
Another good source of CRC information is the CRC entry on Wikipedia, the free encyclopedia:
<http://en.wikipedia.org/wiki/Cyclic_redundancy_check>
Differences between a Checksum and a CRC-8 Checkcode
A CRC is capable of fi nding many more and different types of errors than a checksum can.
A good description of its capability is described in the above referenced articles, but a simple
example show some of the differences well.
Here’s an example of the intended command string:
LI 2,3
Here’s some examples of the original and some badly formed strings, of the above example, and
their associated checksums:
LI 2,3;129
LI 3,2;129
IL 2,3;129
KJ 2,3;129
Notice that every checksum is the same. Checksums cannot detected data being out of order.
Checksums cannot detect errors where two bits, in the same position in two different bytes, are
fl ipped. Checksums are not a very robust way to check for communication errors.
Checksums and CRC-8’s
19HDMI5 Component Video Switch
The value ‘ircmd’ refers to the IR commands that the HDMI5 is able to learn, they are:
IRCmd Description
1 Power Toggle
2 Select Input 1
3 Select Input 2
4 Select Input 3
5 Select Input 4
6 Select Input 5
7 Audio / Video Breakaway Toggle
8 Auxiliary Relay 1 Toggle
9 Auxiliary Relay 2 Toggle
10 Discrete Power On
11 Discrete Power Off
12 Discrete Breakaway Off
13 Sequence through inputs
14 Discrete Audio Breakaway Select
15 Discrete Video Breakaway Select
16 Discrete Auxiliary Relay 1 On
17 Discrete Auxiliary Relay 1 Off
18 Discrete Auxiliary Relay 2 On
19 Discrete Auxiliary Relay 2 Off
Setting an ‘ircmd’ to ‘ircode = 0’, causes that command to no longer respond to IR.
IR codes are always saved in EEPROM.
Front Panel Button Emulation
This command allows access to the internal keyboard handling of the HDMI5, and is very hard-
ware dependent. Button values returned by the HDMI5 may and most likely will be different than
button values returned by other Zektor devices.
Each button generates a value upon being pressed, and a different value upon release.
The Power toggle button also generates a unique value when held for 4 seconds, which is used
to enter the setup mode. Other combinations may also generate unique codes.
This command allows the controller to detect front panel button presses even when the front
panel is disabled. This allows the controller very tight control over the HDMI5. By disabling the
front panel (setting the FP bit to ‘0’ in the “Control Settings” command), and by then process-
ing the front panel button presses of the HDMI5, a controller can redefi ne the operations of the
HDMI5.
HDMI5 Command Ref. (Cont’d)