keymap-master Protocols:
========================
Determining which protocol to use is often the hardest part of 
using KM. This readme file describes some of the various protocols 
that need special attention.




Manual Settings (1- or 2-byte):
-------------------------------
If KM doesn't include support for a given protocol, you may be 
able to set it up with Manual Settings. In the Manual Settings 
workspace on the Setup sheet, you will need to:

1) Enter a Protocol ID (using either a 2-, 3-, or 4-digit hex 
number).

2) Select the appropriate setting for 2nd Cmd Byte (used only when 
building 2-byte protocols). If you're unsure of what you need 
here, post a message at JP1.

3) Select the appropriate Signal Style (again, if you're unsure of 
what to do, post a message).

4) Select the appropriate number of Bits per Device (optional).

5) Select the appropriate number of Bits per Command (optional).

6) Enter the Device Codes and/or Raw Fixed Data in the cells 
immediately below the Protocol Name.

NOTE: Raw Fixed Data, if used, MUST be entered in hex format with 
a space between each byte (i.e. "AA BB CC").

7) 3rd-Party Code: (thanks to John Fine for this suggestion). If 
the selected Remote doesn't offer direct support for a given 
protocol, you may be able to obtain 3rd-party code from one of the 
JP1 resident experts, or another outside source. This code can 
then be entered or pasted (using Excel's Paste Special [Text or 
Values] command) into the Notes section on the Setup sheet.

NOTE: Currently, KM only provides 3rd-Party Code support for S3C8-
based remotes. P8/740 and M6805 code can be pasted, but any 
remote-specific data is NOT automatically updated.

The only "rule" that MUST be followed for this feature to work 
properly is that the pasted code block MUST be in the same exact 
format as the Protocol Code that KM generates, as shown by this 
sample:

Upgrade protocol 0 = 00 00 (S3C8)
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00
End

There can be no extra text before, after, or within the code 
itself (except to the right of the processor ID (i.e. "S3C8") in 
the 1st line. It may then be placed in the Notes section as 
described above. Whenever pasting code into Notes, you MUST use 
Excel's Paste Special ("Text" or "Values") command.

KM is smart enough to detect multiple blocks of code in the Line 
Notes section. It will use the FIRST block of code it finds in the 
Line notes section. This is useful if you want to store different 
versions of a protocol in the Notes section. To "comment out" a 
given block, just precede the first line with any character. For 
example, placing a "*" before the word "Upgrade" will cause KM to 
ignore this particular block of code:

*Upgrade protocol 0 = 00 00 (S3C8)




Device Combiner (2-byte):
-------------------------
The Device Combiner allows you to combine up to 16 different 
protocols into one Device Upgrade. The only requirement is that 
the protocols MUST use single-byte commands. P8-style remotes also 
require that the protocols MUST be built-in (not an upgrade).

There is also an optional Duration Control setting that can be 
used for each function, however, at this time it is only available 
for S3C8 remotes.

Setting up the Device Combiner:

1. First, you need the individual Protocol ID's and Fixed Data for 
each device you wish to combine. You can get this info either from 
the devices4.xls spreadsheet, or you can use keymap-master to 
create the code, and use the values from the Protocol ID and Fixed 
Data cells on the Setup sheet.

2. Next, start a NEW Upgrade in KM, select Device Combiner and 
enter the data that you obtained in step 1 above into the Device 
Combiner table. Remember, you can combine up to 16 devices.

3. Then, go to the Functions sheet and enter the EFC's (EFC-style 
Button Codes MUST be used) for all of the various functions. In 
the byte2 column, enter a zero-based number (0 to 15) (default = 0 
= 1st device) to tell KM which Protocol ID to use. This value can 
be found in the Device Combiner's "#" column on the Setup sheet.

For example, if you want to setup a function for the 2nd protocol 
in the Device Combiner table, the byte2 entry would be "1".

4. Last, to enable Duration Control (S3C8 remotes only) for the 
function, the byte2 entry will be the number from step 3 above, 
then a "space", and then another number from 0 to 15 that 
indicates the duration multiple to be used (default = 0 = none).

For example, if you're setting up a function to use the 2nd 
protocol from the Device Combiner table, and want a duration 
multiple of 3, the byte2 entry would be: "1 3"

Copy and paste the Device Upgrade Code and the Protocol Code into 
IR.exe in the normal fashion.




Combo Protocols:
----------------
Any protocol that includes the word "Combo" in the name is a 
special protocol that allows you to combine functions from 
different devices into one Setup Code. In most cases, you will 
enter the normal OBC or EFC in the appropriate column of the 
Functions sheet and you will enter the device code in the byte2 
column.

There are a few exceptions:


NEC1/NEC2 Combo (2-byte):
-------------------------
This protocol allows you to combine device codes where the 1st 
device code is constant and the 2nd device code changes. For 
example, you could combine NEC1 184.1 and NEC1 184.2, etc.

To do this, enter the main device code (i.e. 184) in device code 1 
on the Setup sheet, and then enter the second device code in the 
byte2 column on the Functions sheet.

If you leave the byte2 column blank, it will be assumed that you 
want to use the 1-device NEC protocol. If you want to use the 2-
device version with the second device set to zero, enter zero in 
the byte2 column.


Panasonic VCR Combo (2-byte):
-----------------------------
This is the official protocol used by setup codes like VCR/1162, 
VCR/0451, and TV/0250. It can only really be used to combine 
Panasonic codes 144.0, 144.1 and 128.0. These are the byte2 values 
and the device code that will result:

0 = 144.0
1 = 128.0
2 = 144.1


Panasonic Combo2 (2-byte):
--------------------------
This is a hacked protocol that works much like the NEC combo. It 
assumes that device1 is constant and gets device2 from the byte2 
column.


Quickie Combo's:
----------------
Some protocols have command codes that are less than 8 bits long. 
When this occurs, UEIC usually uses the extra bit to make a 
quickie combo code.

It works like this: you supply multiple device codes to the 
protocol and then, if the spare bit is zero, the first device code 
will be used; if the spare bit is set, the second device code will 
be used.

Examples of quickie combos are:
  Panasonic (old) = 3 devices (1-byte)
  RC-5x = 3 devices (2-byte)
  Sony = 2 devices (1-byte)




HK Combo (2-byte):
------------------
If you have a Harman-Kardon receiver that uses a combination of 
two different 2-device NEC signals, where the first code is 
128.112 and the second is 130.114, then you need the HK Combo 
protocol. Enter a "0" in the byte2 column to use 128.112 and enter 
a "1" to use 130.114




NEC (1-byte):
-------------
There are primarily 2 versions of the NEC protocol: NEC1 and NEC2. 
The difference between the two is in how the codes repeat when a 
button is held down. Even if you use the wrong version, it will 
probably still work, except that the codes won't repeat (or vice 
versa).

Both NEC1 and NEC2 use either one or two device codes. In truth, 
even the 1-device versions still use two device codes, but the 
second device code is merely the compliment of the first. If you 
only supply one device code, KM will calculate the second code for 
automatically.

Although NEC1 and NEC2 are by far the most popular versions of 
NEC, there are some other variations, which you may find listed 
with names like NEC-30, NEC-04, etc. If you need to use one of 
these protocols, select "NEC1" or "NEC2" and enter the number 
after the dash as the parm. For example, if you need "NEC-30", the 
parm value is "30".

If you have a Harman-Kardon receiver that uses a combination of 
two different 2-device NEC signals, see the HK Combo protocol.




Pioneer (1-byte):
-----------------
Pioneer signals look like NEC signals, and in fact, that's how IR 
and ccf2efc will usually decode them, so you will have to 
recognize these yourself.


Pioneer DVD (1-byte) / Pioneer DVD2 (2-byte):
---------------------------------------------
If some functions send a signal with NEC2 device code 165, but 
some of the other functions send a two-part signal where the first 
part is NEC2, device 165, command 153, and the second part is 
NEC2, device 175, with various command codes, this is the Pioneer 
DVD or Pioneer DVD2 protocol. The correct way to enter these codes 
is as follows:

device code 1 = 163
device code 2 = 175
parm/dev3 = 153

If you leave the fields blank, keymap-master will default to those 
values as they are the only known ones used by this protocol.

To determine the OBC or EFC values: for the 163 single-part 
signals, use the command code (OBC or EFC). For the two-part 
signals, use the command code from the 175 signal (OBC or EFC).


Pioneer MIX (2-byte):
---------------------
Pioneer has started creating new devices that use a similar mix of 
codes as the Pioneer DVD protocols, but they don't follow the same 
rules, so these need to be entered manually using the Pioneer MIX 
protocol. If using the DVD/DVD2 version doesn't work, try this one 
instead.

On the [Setup] sheet, enter the device details:

device1 = the device code found in both the single-style signals 
and the first half of the double-style signals.

device2 = the device code found in the second half of the double-
style signals.

cmd1 = the OBC command code used in the first half of most of the 
double-style signals.

cmd2 = the OBC command code used in the rest of the double-style 
signals (if present)

Then on the [Functions] sheet, you indicate which style of signal 
to use for each function. Do this by entering one of the following 
values in the byte2 column:

0 = single-style signal (using device code 1)
1 = double-style signal (using dev1/cmd1 in the first half)
3 = double-style signal (using dev1/cmd2 in the first half)


Pioneer 2CMD (2-byte):
----------------------
If some of the functions for your device send a two-part signal 
where the device code is the same but the command code varies, you 
need to use the Pioneer 2CMD protocol.

For the functions that only use one command code, enter the same 
command in both the regular OBC/EFC column and the byte2 column of 
the Functions sheet.

For the functions that use two codes, enter the first one in the 
OBC/EFC column and the second in the byte2 column.


Pioneer 3DEV (2-byte):
----------------------
If the functions for your device use one of up to three different 
device codes, and some of the functions even send a two-part 
signal as described above, then you need to use the "Pioneer 3DEV" 
protocol.

Enter the three device codes, and then, on the Functions sheet, 
enter the command codes in the regular OBC/EFC column.

In the byte2 column enter a "1", "2", or "3" to indicate which 
device code to use. If this particular function uses a two-part 
signal, put a space after the device code number and then enter 
the EFC or OBC.

For example, if device code 1 is 130, and the ENTER button sends a 
two-part signal where the first part is device 130, command 123, 
and the second part is device 130, command 133, you would enter 
"123" in the OBC/EFC column, and then "1 133" in the byte2 column.

NOTE: While this protocol supports both OBC's and EFC's, this 
version is LSB, where most of the other Pioneer protocols are LSB-
COMP, so the EFC's will be different. Therefore, it is STONGLY 
recommended that you use OBC's when setting up the Pioneer 3DEV 
protocol.




RC-5 (1-byte):
--------------
RC-5 is a quickie combo protocol, allowing you to combine up to 
three RC-5 device codes. You select which device code you wish a 
function to use by entering the OBC in the OBC column of the 
Functions sheet, and then entering a "0", "1", or "2" in the byte2 
column. However, you will only have access to OBC's 0 - 63. In 
order to access OBC's in the range 64 - 127, you will need to add 
100 to the device code entered.

For example, if you wish to program functions using RC-5, device 
code 4, and you wish to use OBC's 0 - 63, you would set it up as 
follows:

Device Code 1 = 4
Device Code 2 = 104 (4 + 100)
Parm/Dev3 = doesn't matter (see note)

Then, to program a function with an OBC in the range 0 - 63, you 
would leave the byte2 column blank, and to program a function in 
the range 64 - 127, you would enter "1" in the byte2 column.

NOTE: You can also combine a third set of codes by supplying a 
value in the Parm/Dev3 cell, but you can only use one range of 
OBC's.




RC-5/5x Combo (2-byte):
-----------------------
The RC-5/5x Combo protocol allows you to combine functions that 
use both RC-5 and RC-5x codes.

RC-5 codes use a device code and a command code (OBC), whereas RC-
5x codes use a device code, a unit code, and a command code (OBC).

To setup this combo, you MUST use OBC-style Button Codes (EFC's 
are not supported). Enter the OBC's in the OBC column (B) on the 
[Functions] sheet.

The byte2 information is entered as follows:

For an RC-5 command, simply enter the device code.

For an RC-5x command, you need to enter the device code in one of 
the four cells on the [Setup] sheet, then in the byte2 column, you 
enter a number to indicate which of the 4 RC-5x device codes you 
want to use ('1'=1st, '2'=2nd, '3'=3rd, '4'=4th), followed by a 
space, followed by the unit code. For example, to program a 
function that uses RC-5x, device code 12, and unit code 6, you 
would enter '12' in the "RC-5x Dev1" cell on the [Setup] sheet, 
then in the byte2 column you would enter '1 6'.




Sony:
-----
There are 3 variations of the Sony protocol: Sony12, Sony15 and 
Sony20, as well as Sony Combo and Sony DSP.


Sony12/15 (1-byte):
-------------------
To setup a code using either Sony12 or Sony15, select the 
"Sony12/15" protocol. Using this protocol, you can combine 2 
different Sony device codes. On the Functions sheet, if you leave 
the byte2 column blank, device code 1 will be used, and if you 
enter a "1" in this column, device code 2 will be used.


Sony20 (1-byte):
----------------
If you need to setup a signal using the Sony20 protocol, select 
the "Sony20" protocol. This uses 2 device codes in its signals, so 
you will need to supply two device codes. You can also combine 
functions from a Sony12 code if you supply a Sony12 device code in 
the parm cell, then if you enter a "1" in the byte2 column this 
code will be used.

NOTE: The option to specify byte2 is only available when using 
OBC-style button codes.


Sony Combo (2-byte):
--------------------
This combo protocol allows you to combine as many Sony12 and 
Sony15 codes as you like with up to 4 Sony20 codes. You enter the 
codes for the functions in OBC format as usual. Then in the byte2 
column you enter the Sony12 or Sony15 device code. For Sony20 
functions, you need to enter the 8-bit subdevice code in the four 
device code cells in the Setup sheet. Then in the byte2 column you 
need to enter a 1-digit number indicating which of those 4 sub-
devices you wish to use (1, 2, 3, or 4), followed by a space, 
followed by the 5-bit main device code.

For Sony12/15 codes, the spreadsheet will treat device codes 0 
thru 31 as Sony12, and codes 32 thru 255 as Sony15. However, if 
you wish to explicitly specify which version you want, enter a "5" 
for Sony12 and a "6" for Sony15, followed by a space, and then the 
device code.

