The most common way to code the signals is to vary the length of the pulses or the length of the spaces or alter the order between pulses and spaces. That means that 1 and 0 has different pulse lenghts or different lengths in the space between the pulses.
* A pulse coded signal varies the length of the pulses:
+--+ +--+ +----+ +----+ Sony uses this kind of coding | | | | | | | | --+ +--+ +--+ +--+ +-- 0 0 1 1* A space coded signal varies the length of the spaces:
+--+ +--+ +--+ +--+ Panasonic uses this kind of coding | | | | | | | | --+ +--+ +----+ +----+ +-- 0 1 1* A shift coded signal alters the order of pulse space:
+--+ +--+--+ +--+ Philips uses this kind of coding | | | | | | --+ +--+ +--+--+ + 0 1 0In addition to this are headers often used. A header is a pulse that are transmited before the actual code, and is used to activate the reciever. The header is always the same for a brand and does not differ for different codes.
+----------+ +--+ +--+ | | | | | | + +----+ +--+ +...... \______________/\_________...... Header CodeThe header and code are transmitted over and over as long as a button is pressed on the remotecontrol. A normal repetition time is ~50ms.
But the signal is read and with adjustments it is possible to make a fuctional remote. This is not an easy task though.
The package contains (as HP binaries) in hp48bin:
REMOTE - The main directory.
MAKE - Contains all the programs for reading codes from remotes.
LEARN - Contains Programs for learning new remotes (this part is not functioning well but is included to play around with)
remotes - that is a directory with some remotes in to start with. They are divided in brands with documentation on each brand.
Before you can use the program you need to download the REMOTE dir to the HP and set it up for the right type (SX or GX). Here is what you do:
##REW## #PLAY## ##FF### #STOP## #PAUSE# ##REC## OPERA CH- CH+ SLO- SLO+ PRGM CANC GOTO DISP CRES SP/LP AMON EJECTAll the keys now have three functions:
By pressing Arrow up or Arrow down you can switch to the other menu rows. The row that is normal is using the keys A-F to transmit the code.
To turn on the video press Arrow Down and then A.
To end the remote program just press ON (Pressing ON once will exit the remote and return to the main screen). Shift right and ON will switch off the HP (as normal) without leaving the remote program.
To switch faster between remotes it is possible to press rigth and left arrow. The program will switch to remotes in the order they are in the REMOTES directory.
The advantage of using this program is that when you have sampled a remote and made a directory for it on the HP, it is easy to pass it on to others since all the information about the remote is in that directory. That makes it easy to trade remotes with others. I would be glad to have a copy of new working remotes so that I can keep a database of all the remotes this program can cope with. It would also be good if you make a new remote to include the codes for it. in the same way they are listed in the docs for all the remotes.
I use this little program assinged to right shift NXT to start the remote program:
<< RCLMENU PATH HOME REMOTE Start EVAL MENU >>It will leave the HP in the same status as it was before the REMOTE program was started. And it makes it possible to start it from any directory.
If it is one of the menukeys you will be able to alter the command name first and then alter the code. If you don't want to alter the command name just press ENTER, otherwise alter the name and then press ENTER.
If it is the ENTER key row and down you will only be able to alter the keys code.
All the codes must be entered as binaries and in HEX.
MAKE also needs to be set up for the right verion of HP48. In there is two programs in MAKE: SX and GX. Run the programs that corresponds to your HP48. Those programs will be deleted after they are run.
To read new codes just select the right menurow and press shift right and the right key. If it is a menu row the program will let you alter the name of the command. Once that is done the HP will turn off the screen and wait for a code from the remote. Try to hold the remote as close as possible to the IRport on the HP. If you have a SX or GX take the cover off. Try also to find exactly where the transmitting diod is on the remotecontrol in order to put that as close as possible to the IR port on the hp.
| | | | | Remote | | Control | ------ | -------- /------------------\ |/----------------\| I have had best results in learning || || new remotes when I took off the cover on the HP || HP48 || and held the remote close to the IR-port || || and had the remote sligtly tilted to || || the HP48. |\----------------/| |[ ][ ][ ][ ][ ][ ]| |[ ][ ][ ][ ][ ][ ]| |[ ][ ][ ][ ][ ][ ]| |[ ][ ][ ][ ][ ][ ]| |[ ][ ][ ][ ][ ]| |[] [ ] [ ] [ ] [ ]| |[] [ ] [ ] [ ] [ ]| |[] [ ] [ ] [ ] [ ]| |[] [ ] [ ] [ ] [ ]| \------------------/Press the key on the remote that you want to sample. When you press the key on the remote the screen on the HP should turn on again. Then wait a while, then you will be able to see the old code stored and the read code. On the bottom row you will have the code to store. Normally you just press enter and the code will be stored.
If you wait too long between pressing the key on the HP and the remote the HP will timeout and continue. If that happens then you have to start over again.
Be aware of one thing: If the code Read: #...h contains a binary with more
than 4 numbers check that the starting numbers are the same as the ones
in the GROUP var. If not you will not get the right codes. If the code differ
then you have to store the new group. The GROUP should be the numbers before
the numbers on the input line.
Eg.
When the HP shows:
/------------------------\ |Old: # 48h | |Read: #11648B7h | |Enter code: | | | |# 48h | |[ ][ ][ ][ ][ ][ ]| \------------------------/Then the number #116 is the number that needs to be matched in the GROUP var.
If you can only find the documentation for the remote and not the HP48 binary look at TABLE.TXT. That file lists all the supported remotes. Compare the brand you want to use with other brands in the list. If you find a match you can take a remote from the other brand and use it for sampling your remote.
If you have found the brand then copy one of the remotes and rename it to the equipment you want to use. Then download it to the HP under REMOTES. Now do as the READING A CODE section says.
If the brand you have is not supported then you need to read the chapter LEARNING A NEW REMOTE.
The learning program has been improved since the previous version but it still has problems. It is not functioning well at all times. It has a higher probability to work better on a G(X). The problem is that the HP cannot sample fast enough, so the carrier frequency that many remotes use could make the HP to decode the signal wrong. I am trying to go around that but the fact remains that the sampling theorem says that it can't be done since the HP48S(X) only can sample at a frequency of 29kHz, and a G(X) can sample in approx 44kHz. And they need to sample at a rate of > 80kHz to sample the signal right.
To learn a new remote, go to the READ directory in the MAKE directory. Now you have to install LEARN (if you haven't done that already). In LEARN directory you will find LEARN Draw and TEST.
LEARN is the program to generate data to make a infostring. Draw is used to draw the sampled signal on screen. TEST will sample and draw the tree first transmissions.
Use TEST first. It will show you how the signal looks like. TEST is used as LEARN below. TEST will draw the three first signals from the remote. If they look the same then you should be able to generate a infostring. One thing though, some remotes sends a stop code after the real code and that is not shown by TEST. Yamaha works this way. If this is the case then this package will not help you. This is because then you will need more than one infostring to make it work. This type of codes will not be detected by this package.
(Note for G/GX users: If the sampling doesn't seem to work at all, if the HP just seems to be running the program endlessly you can try one thing: In the READ directory (under { HOME REMOTE MAKE } there is a variable called SAMPLE which is a string. Try to double the length of that string.)
Press LEARN and when the screen goes blank hold the remote control as close as possible to the HP's irport (you should also take the cover off). Press any button on the remote until the screen goes back on again. Then wait a while (about a half minute).
Now you will have a list on level 1. The list will consist of:
{ n (h1,h2) (p1,p2) (s1,s2) (sp1,sp2) m }
Where:
n is the length of the code in bits.
(h1,h2) is the length of the header (of there are no header then this will be missing).
(p1,p2) is the length of one codeing
(s1,s2) is the length of zero coding
(sp1,sp2) is the length between transmissions
m is the coding type 1 means space modulated, 0 means pulse modulated
All lengths are in micro seconds.
If there are more than 4 complex numbers in the list then the sample was no good. Then you have to try again. I know that Bang&Olufsen will not work due to their high carrier frequency (550kHz). I have tried it on JVC, Sony, Funai and Canon with successful results.
When you have a list that seems right then press MKSTR. now you will have a string that ought to work.
In the package there is a file called TABLE.TXT. It has all the data from all the supported remotes. Look in that and compare the data that you got. If you find a remote that has very close timing to what you got, then there is a very good chance that you can use that remote and just change the data in it. To see the contents of the string you made press Show. If you don't find any or if you don't get it to work, do the following.
The list will be stored in L and the infostring will be stored in INFO. Recall INFO and store it under a new name in the REMOTE directory. You have to make a new directory for that remote. It can help if you take a supported remote and just save the new infostring in that. But you must store the infostring as CODE. If you get a code longer than 16 bits use the panasonic video. If the code is up to 16 bits use the Sony CD.
Now you can do as in chapter HOW TO CUSTOMIZE THE GENERAL REMOTE PROGRAM to learn new codes.
If the infostring seems right but the codes doesnot work then the length of the pulses might be too short. Try to make the pulses a bit longer by altering them maually. (using HEADER, ONE and ZERO in the MAKE directory).
I am trying to fix this timing problem.
It can also be that the remote control sends controlbits before and/or after the actual code. This is the case with Yamaha and Grundig. If that is the case then there is no possibility to easily cope with that without creating the code manually. The problem is that the remote needs more that one infostring.
If you sample a new remote and use test and see that the first and the third code looks the same, but the second code is different.Then the second code might be inverted. Sharp does this. Then you can try to use the Sharp TV remote. Those remotes are little special and need more than one infostring. The best thing you can do then is to use the infostings that is in that directory, and just replace the timing of header and one and zero and space. Also you need to change the length of the code.
Just make shure to store the MAKE directory in the REMOTE directory when loaded back in the HP, otherwise it will not work properly.
Every remote will take up approx 400-500 bytes. The REMOTE directory will take up approx 3500bytes and more (depending on how many remotes that are loaded in the system).
If you don't want ot use the menusystem then the only program that is used for transmission is the TRANSMIT program. So if you want write your own programs you only need TRANSMIT and the right infostrings.
To transmit a code just put the apropriate infostring on level 2 and the code on level 1 and press TRANSMIT. (TRANSMIT is located in the main directory, the REMOTE directory) Note: Some remotes needs more than one INFOSTRING to work properly. Grundig uses 3 INFOSTRINGS. The easiest way to see how TRANSMIT is used in these cases is to look at how REM works for those remotes.
The infostrings that I have managed to get so far are in the INFO directory.
Eg to play a sony CD:
You will need to have the Sony CD remote dir in the calc.
Go to the Sony dir (it should be in the REMOTES dir).
Press CODE. (It will recall the infostring for that remote to the stack.)
Enter #8B2h
Press TRANSMIT (TRANSMIT is in the main directory)
or in a program
<< REMOTE REMOTES CD CODE #8B2h TRANSMIT >>
WARNING WARNING WARNING!!!!
The TRANSMIT program just checks that the data is there but not if it makes
sense. If an invalid string is used the HP48 might transmit for a very long
time. The only way to stop the program then is to press the reset button, since
the program turns off the display and the interrupts.
However it can not destroy any memory becauce is does not write to the memory
except to the irled. But improperly used it can drain your batteries very fast.
If you have a remote that seems to do a command more than once look at REPS below.
In order to view an infostring or edit it, the string must be on level 1 on the stack. In all the remotes it is the var called CODE. In the pacakage there is a program called Show that displays all the information in the infostring. Show is located in the LEARN dir. You have to donload LEARN to the HP to use Show.
All the commands that are used to make an infostring works in two ways. The commands are HEADER, ONE, ZERO, LEN, SPACE, REV, Inv, Mod, REPS and FLAGS. And they are located in MAKE.
All those programs work on two ways:
---------------------------------------
Read infostring:
HEADER ONE ZERO programs:
If the infostring is on level 1 on the stack then HEADER or ONE or ZERO will reall the info for the header one or zero respectivily.
Eg.
HEADER Will produce:
_______________________ _______________________ |_______________________| |_______________________| |4: | |4: | |3: | |3: | |2: | -> |2: infostring | |1: infostring | |1: { aaa bbb n } | |xxx xxx xxx xxx xxx xxx| |xxx xxx xxx xxx xxx xxx|Where
aaa
is the time for the pulse in micro seconds,
bbb
is the time for the space in micro seconds
and n
is the number of repetitions of the header.
Some remotes only transmit the header the first time the code
is transmitted. JVC does this. But normally the header (if it
is transmitted) is transmitted all the time.
For sony string the list will be: { 2192 592 0 }
For ONE and ZERO n will be the order of transmission.
n=1 -> transmits pulse space
n=0 -> transmits space pulse
In this case almost all remotes will have n=0.
----------------------------------------
LEN:
Sets the length of the code.
2: infostring
1: real number
Just put the number of bits as a real and press LEN.
Eg.
2: infostring
1: 12
LEN
Will set the code length to 12 bits.
-----------------------------------------
SPACE:
Sets the space between the transmissions.
2: infostring
1: real number
Just put the length of the space as a real and press SPACE.
Eg.
2: infostring
1: 23000
Will set the space between the transmissions to approx 23ms.
-----------------------------------------
REPS:
Sets the number of repetitions for a code (The minimum amount of transmissions of the code).
2: infostring
1: real number
Just put the number of repetitions as a real and press REPS.
Eg.
2: infostring
1: 3
REPS
Will set the repetitions of the code to 3.
-----------------------------------------
Rev:
Sets if the code is to be reversed before transmission.
(Sets the transmission order, MSB first or LSB first)
THis option has nothing to do with the remote. It is only for convinience.
Some codes are more easily decoded if the code is reversed.
Normally you don't have to change this parameter, but it could make the codes more understandable if you change the transmission order.
Eg to recall data.
Press Rev :
_______________________ _______________________ |_______________________| |_______________________| |4: | |4: | |3: | |3: | |2: | -> |2: infostring | |1: infostring | |1: n | |xxx xxx xxx xxx xxx xxx| |xxx xxx xxx xxx xxx xxx|Where n is 1 or 0.
To alter put the number on level 1 and infostring on level 2:
Press Rev :
_______________________ _______________________ |_______________________| |_______________________| |4: | |4: | |3: | |3: | |2: infostring | -> |2: | |1: n | |1: infostring | |xxx xxx xxx xxx xxx xxx| |xxx xxx xxx xxx xxx xxx|-----------------------------------------
-----------------------------------------
Mod:
Same as above, but
0 means don't add a pluse after the code (used if the code is pulse modulated)
1 means add a pulse after the code (used if the code is space modulated)
REMOTE | +---+--+ | | MAKE REMOTES | | +----+ +--+---------+-----... | | | | READ INFOWhen you are using remotes and are not learning new functions you can purge the MAKE branch to save memory.... | LEARN
Main directory contains(called REMOTE):
These two programs will only exsist the first time you download the directory.
SX - Customizing program for the HP48S(X) series
GX - Customizing program for the HP48G(X) series
Start - The main program REMOTES - subdirectory with remotes Size - The variable containing the length of the codes ALARM - The program to use with the alarm REM - The program that transmits the codes CONV - The program tha prepares read data TRANSMIT - the transmission program (machine dependent, S(X) and G(X) has different versions).
The following are help programs and should not be used directly:
Select, Tog, Build, Prg, Put, Get, READ, DISPON, DISPOFF, CK, K->P, S->B, B->S
---------------------------------------------------------------
MAKE directory contains: (MAKE must be a subdirectory of REMOTE)
These two programs will only exsist the first time you download the directory.
SX - Customizing program for the HP48S(X) series
GX - Customizing program for the HP48G(X) series
READ - subdirectory for reading remote codes (see below)
Show - shows all the info from an infostring
HEADER - shows or sets the header data
ONE - shows or sets the 1 data
ZERO - shows or sets the 0 data
LEN - shows or sets the length
SPACE - shows or sets the space between transmissions
REV - toggles if the data is to be reversed
Inv - toggles if an inverted copy is to be added
Mod - toggels of a pulse is to be added after the code
REPS - shows or sets the number of repetitions
SPOS - Shows or sets from which sample to decode
Flags - Shows or sets the flags that control of the transmit program
Help programs that you should not use directly:
S->R, R->S, T->P, P->T, S->T, T->S
Programs that you can use:
READIR - Reads a code for the infosting in INFO
INFO - The infostring that are created or used by READIR
SAMPLE - the string used by IRLEARN
Help programs that you should not use directly:
MAXLEN - It is a variable containing the length that decides when the code ends
REVERSE - reverses the code
T - Used by LEARN, READIR and Draw
DECODE
SHDEC
IRLEARN - Mlcode used by LEARN, READIR and TEST
NS
GI
M->T - This program is specific for S(X) and G(X)
M->R
---------------------------------------------------------------
LEARN directory contains: (LEARN must be a subdirectory to READ)
TEST - Does a test sample and draw the three first codes
Draw - Draws the looks of a sampled signal
LEARN - Reads the code and produces a list with the info needed the list is stored in L
L - The list created by LEARN
GETLEN - Used by LEARN
MKSTRING - Makes a info sting of a list (in the L var, produced by LEARN)
Press Show to view all the information of the string. Or press HEADER to see the header info press ONE to see the 1 info and so on. (Contents of an infostring see below)
Infostring: (25 chars)
1 2 3 4 5 6 7 8 9 10 | | | | | | | | | | | | | | |XX| | | |XX| | | | | |XX| | | |XX| | | | LSB | MSB | LSB | MSB | | LSB | MSB | LSB | MSB | | | Pulse | Space Reps | Pulse | Space |Order| | Header | 1 | | | | 11 12 13 14 15 16 17 18 19 20 21 22 | | | | | | | | | | | | | | | | |XX| | | |XX| | | | | | | |XX| | | | | | | | | | LSB | MSB | LSB | MSB | | | LSB | MSB | | | | | | Pulse Space Order|Data | Trans |Rev |Inv |Add |Repeat | 0 |Len | Space |Data |Data |Pulse| | | | | | | | | | The 3 last chars in the infostring are optional 23 24 25 | | | | | | | | | | | | | | | |Sampl| Flags | |Start| | Head: Pulse: length of pulse, if length = 0 then there are no header Space: time to next bit Reps: 0 = send header always 1-9 send header that number of times 1,0: Pulse: length of pulse Space: time to next bit Order: 48 "0" => space pulse : 49 "1" => pulse space Data len : length of data in bits Trans space: specifies the time between the repetitions of the data Rev Data : 82 "R" => reversed 32 " " => not reversed Inv Data : 73 "I" => the data is reversed and added to the data -> data+inv(data). 32 " " => ignored Add Pulse : 65 "A" => a pulse is transmitted after the last bit. 32 " " => ignored Repeat : "0"-"?"=> the transmission is repeated (0-15) times if no key is pressed (if the program is run as a batch job and not manually) Sampl start : If included specifies from which sample to decode Flags : If included they can change the way transmit program works Bit0: If the interrupts should be turned off (1 = don't turn off) Bit1: If the interrupts should be turned on (1 = don't turn on) Bit2: If the keboard should be scanned (1 = don't scan) Bit3: If a space is to be at the end (1 = make a space) Bit4:
If you successfully learns new remotes please mail me the new code so that I can keep a database of remotes so that others don't have to sample new remotes more than they have to.
Björn Gahm d89-bga@nada.kth.se
Sikrenovägen 4
182 76 Stocksund
Sweden
Tel: +46 8 85 58 23