                            SonyIR Explore
                            Version 0.3.1
                            Sept 16, 1999

What does this program do?

This program is used to find and verify the IR codes used to control Sony
products that utilize a 12 bit IR protocol. The 12 bit code is represented as
a three digit hexadecimal number (0x000 - 0xFFF) giving a total 4096 codes.
My TV uses codes in the 0x080 - 0x0FF range with 0x095 being toggle power.
The MiniDisc products appear to use the 0x780 - 0x7FF range with 0x795 being
toggle power. There is a good chance that other Sony products that use this
protocol also have their power toggle code ending in 95
(ie 0x195, 0x495, 0xC95...).

This program has been tested on both the Siena and 3c. Sorry, it will not
run on a Series 5. (see bottom of file for more on Series 5) On the 3c be
careful not to cover the IR Window with your left finger when holding the
3c. The window makes a nice finger rest.

Range varies depending on the product you are controlling. I get about
3 meters (12 feet) when controlling my Sony TV with either a Siena or 3c.
But I have also seen 24 inches when controlling an RCA TV (not with this
program which only works with Sony products).

You can use this program to step through any of the 4096 Sony codes.  Once a
code is found that activates some function it can be recorded in a standard
Psion database.  The included database has over one hundred codes for TV and
MiniDisc.  (Thanks to Brian Weeks for the MiniDisc codes.)  You are encouraged
to search for others and add them to the database or create your own database.
A database need not exist to run the program.  Not all TVs support all the
defined functions.  When you do find new functions please send them back to me
to be included in a master file.  There is a comment field for each key where
you can enter any additional information.

This package contains the following three (3) files:

README.TXT  : This file.
SONYIR.OPO  : The program. Place in the \OPO directory.
SONYIR1.DBF : Starter database of over 100 Sony IR codes for TVs and MiniDisc.
              Place in the \DAT directory.


SONYIR is actually a subset of a more powerful program called IREXPLOR.
Where SonyIR is hardwired for Sony products IREXPLOR can be tailored to
recreate a vast number of protocols. There are currently nineteen parameters
used to define each IR protocol. Definitions exist for AIWA, Furby (the toy),
JVC, Onkyo, Magnavox, Panasonic, Pioneer, RCA, PrimeStar and many more. Since
there are so many parameters to setup it is not clear if I will release
IREXPLOR to the general public. I may instead release separate versions like
SONYIR that are preset for each brand.

IREXPLOR and its derivatives (SONYIR) are intended to be used to discover and
verify IR codes. The programs are not intended to be used as a remote control
replacement.

A Psion remote control replacement program is still in the works. This program
will use the data collected from IREXPLOR to allow a user to customize keys
on your Psion to control whatever devices you want. I have a hardcoded
prototype that runs on my Siena that controls my VCR, Receiver, and CD.


Can't you just make a learning remote and skip all this SONYIR and EXPLORE
stuff?

No. The Psion does not have the hardware to sample the IR port directly.
I do use an HP-95LX palmtop to sample IR Remotes and decode there protocols.
If you have an HP-95LX or access to one you can run a program called IR95.
Just teach it the keys on your remote and send me the resulting .KIR file.
This is how the MiniDisc code were gotten thanks to Brian Weeks.


I don't have a Sony product?

The quickest way to get a version written for your brand is to get a hold of
an HP-95LX and the program IR95 (from the web). With that you can record the
keys for your model into a .KIR file that I can decode. With that information
it is normally possible to create a version of the program for you to test.


Some History/Background:

I have been asked many times over the last couple of years if there was any way
to turn the Psion into a remote control. Since the Siena,3c, and Series 5 have
IR ports and are programmable this might not seem like a difficult task. HP
Palmtops and Pilots can do it. So why not the Psion?

Unfortunately, the IR port built into the Psion products are designed only to
communicate with other Psions or PCs and are hardwired to a device called a
UART. This device places severe limits on the type of IR pulses that can be
generated and makes it impossible to detect remote type IR signals with
enough resolution to allow them to be reproduced. UARTs require a start and
stop pulse to begin and end the transmission of each data character (5-8 bits).
The IR pulses are also rigidly controlled by the selected baud rate.

IR Remotes use modulated pulses of IR light. When a pulse of IR is being
sent it is actually made up of IR light being pulsed at a 35-40 kHz rate.
It is something like morse code where you have a series of short and long
pulses. But the short and long pulses are themselves made up of tiny pulses.
The space between pulses is also important. Some IR protocols use a fixed
pulse size but vary the time between pulses to represent zeroes and ones.
Others vary the pulse size and keep the space between constant and still
others vary both the pulse size and space size.

The bursts of IR are anywhere from hundreds of microseconds to milliseconds
in duration followed by no IR for the same range of times. These bursts of
IR and no IR are what make up the code. A UART can detect the pulses but has
trouble determining the duration and has no way to determine the time between
pulses. So the best the Psion can do is tell you when an IR Remote key is
being pressed but not what key.

The HP series of plamtops (95LX,100LX,200LX) do provide direct program
access to the IR detector. Learning IR remote programs for the HP, such as
the program IR95, sit in a tight loop counting the number of instruction
cycles IR is detected and IR is not detected. It is actually a little more
complicated since the "pulse" of IR is itself made up of pulses at 35-40 kHz.
So when IR is detected a pulse is active but if no IR is detected you might
be between 40kHz pulses. This is resolved by post processing the data to
smooth out the little holes in the pulses. None of this is even remotely
possible on the Psion. However the HP makes a good tool to capture and
decode IR Remote signals and is one method I use (and others have used) to
create the data necessary to program a Psion to recreate the signals.

After several attempts I finally succeeded in July of 1999 in developing a
method to recreate a close approximation of an IR Remote signal on my Siena.
To my knowledge this is the first a program running on a Psion has been able
to do this.


Why won't it run on a Series 5?

For the Series 5 Psion decided to drop support for IR access from OPL. But
there is hope. What I need is for someone to write an OPX that gives me
back direct control of the IR port from OPL. I need to be able to open the
IR port at a certain baud rate and then write characters out. Here is what
the code looks like on the Siena and 3c:

     LOPEN "TTY:I"         REM The "I" here means IR PORT
     IOW(-1,7,S&(),a%)     REM sets the baud rate as defined by S&()
     IOW(-1,RA%,RX%)       REM Sends RX% bytes of RA%

Actually, I think only the first line is the problem. The -1 in the next two
lines says use the currently open device.

With the touch screen the Series 5 would make a nice Remote Control replacement.

