One For All

Developer’s Manual

A Guide to Writing Software for Use with One For All IR Remote Controls

Home | Device Codes | Pictures | Make EFC Table | Serial Cable | Serial Software
John Somers Program | Ziggr's Page

Models Covered:

URC-2005 (OFA-5)

URC-4005 (OFA-6)

URC-6050 (OFA-8)

URC-5000 (OFA-12)

The information for the models listed above were correct as of 3/95. However, because the programming features described in this manual are not supported by Universal Electronics, the specifications may change at any time without notice.

One For All Developer’s Manual Introduction

Certain models of the One For All infrared remote controls produced by Universal Electronics Inc. have a serial I/O port located inside the battery compartment. This serial port was originally designed to allow uploading of new IR codes to the remote. However, it is also possible to use this serial port to take control of the remote’s keypad. With the correct software and connecting cable, any keypress on the remote can be commanded, allowing a connected computer to command the OFA to perform any of its functions.

Although this serial port is the same one used by Universal Electronics Inc. to upgrade their OFA remotes, this document does not discuss the codes or method used for uploading codes to the remotes. This information is proprietory and it is unlikely that Universal Electronics will provide any information on this capability.

The models covered by this document include (but are not necessarily limited to) URC-2005 (OFA-5), URC-4005 (OFA-6), URC-6050 (OFA-8), and URC-5000 (OFA-12). Older-style OFA-6 remotes (URC-4000 and URC-4050) should operate similar to the OFA-12, but the keycodes will likely be different. Universal Electronics Inc. does not support the serial port interface as a product, so this information can change at any time without prior notification.

Disclaimer:

This manual is provided for informational purposes only. Neither Home Automation Systems, Inc., nor Universal Electronics supports development of software for the OFA remotes. No technical support will be provided on software development. If you are intending to develop software for commercial purposes please be aware that Universal Electronics may change the codes and specifications of their remotes at any time without prior notice.

 

Electrical Interfacing

Inside the battery compartment of certain upgradeable OFA remotes is a three-pin serial port connection. Please note that this serial port is not equivalent to a standard RS-232C serial port. Interfacing the OFA’s serial port to a standard RS-232C serial port (as found on most personal computers) requires a special interface cable containing solid-state electronics. This interface cable is available through Home Automation Systems, Inc. (HAS-4050). The cable has a standard DB-9 (female) connector for interfacing to a PC’s 9-pin (male) serial port on one end and a three-pin plug for interfacing to the OFA remote on the other. Please note that the OFA remote’s internal connector is not designed for repeated connecting and disconnecting of the plug. A dedicated OFA remote is recommended for this application so that the cable can be left plugged in at all times. If the remote will be connected and disconnected frequently, we recommend attaching a permanent, more robust connector to the remote and connecting the serial cable to the new connector. This will prevent wear on the remote’s serial port which could inhibit its function.

Pinout of DB-9 Connector

Pin

Function

1

(not used)

2

data received from OFA (QFA --> PC)

3

data transmitted to OFA (PC --> OFA)

4

DTR (data terminal ready)

5

signal ground

6

(not used)

7

RTS (ready to send)

8

(not used)

9

(not used)

 

Some personal computers are equipped with a DB-25 (male) connector instead of the DB-9. Standard 25-pin (female) to 9-pin (male) connectors are available from most computer stores. If you prefer to make your own, please follow the following wiring chart.

Connection Diagram for DB-9 to DB-25 Adapter Cable

Pin on DB-9 (male)

Pin on DB-25 (female)

2

3

3

2

4

20

5

7

7

4

 

OFA-5, -6, and -8 Serial Interface Protocol

In order for the OFA-5, -6, and -8 remotes to communicate with the PC, both units must follow the same protocol. The serial port parameters for proper communication are 9600 baud, 8 data bits, no parity, 1 stop bit. The serial port should be configured for half-duplex communication, as simultaneous transmit and receive is not supported. Additionally, during communication DTR needs to be set high, and RTS needs to be set low (more on these later).

Note: Before connecting the interface cable to the OFA remote and PC, be sure to bring DTR and RTS low; this removes power from the interface cable’s circuitry and allows the system to properly initialize.

Sending Commands to the OFA-5, -6, and -8

The newer OFA-5, -6, and -8 remotes require a single wake-up sequence, unlike the older OFA-12 remotes which require a wake-up prior to each IR sequence. The remote will stay in keypress mode until a shut-down code is sent (or the batteries run down). To wake up the remote and put it in keypress mode, the following sequence must be followed:

1. Press any key on the remote. (This is inconvenient, but unfortunately required in the current generation of OFA remotes. Fortunately, once the remote is in keypress mode, there is no further need to press any buttons.)

2. Write a "W" to the serial port. A 0x06 should be returned.

3. Write a "K" to the serial port. This puts the remote in keypress mode.

Now you can send the keycode you wish to execute. (Lists of OFA-5, -6, and -8 keycodes are found at the end of this document.) The OFA remote will execute the command as if the corresponding button on the remote had been pressed. Please note that while the OFA is in keypress mode, the physical keypad will not function.

You may continue to send keycodes to the OFA for execution. As the remote will ignore keycodes sent too fast, you should insert a delay between keycodes (50-100 msec should be plenty of time, but you may determine the optimum time for your remote).

To return to normal operation (leave keypress mode), send ASC// 255. The OFA remote’s LED will blink twice and the remote will go back to sleep (normal operation). The keypad will once again be available for normal use. To send additional codes, it is necessary to start again with the wake-up sequence.

OFA- 12 Serial Interface Protocol

In order for the OFA- 12 remote to communicate with the PC, both units must follow the same protocol. The serial port parameters for proper communication are 4800 baud, 1 start bit, 8 data bits, no parity, 1 stop bit. The serial port should be configured for half-duplex communication, as simultaneous transmit and receive is not supported. Additionally, during communication DTR needs to be set high, and RTS needs to be set low (more on these later).

Note: Before connecting the interface cable to the OFA remote and PC, be sure to bring DTR and RTS low; this removes power from the interface cable’s circuitry and allows the system to properly initialize.

 

Sending Commands to the OFA- 12

After processing each command, the OFA- 12 remote powers itself down. To wake up the OFA- 12, the following sequence needs to be followed.

1. Set DTR high.

2. Send a BREAK command for at least 50 msec. (The actual time specification is 15 msec, but some OFA-12’s take slightly longer to wake up. A 50 msec BREAK command is usually sufficient; to be ultra-safe, send a BREAK for 100 msec.)

3. Wait for the Wake-up Acknowledge signal (WAK = O6Eh).

Next, send the Serial Execute Command (SEC = OBCh) and wait for a Serial Execute Command Acknowledge (SAK = O6Fh).

Now send the keycode command you want the OFA-12 to execute. (A list of OFA-12 keycodes is listed at the end of this document.) The OFA- 12 remote will execute the keycode command as if a button on the keypad was pressed. After executing the command, the OFA- 12 remote will echo back the last keycode processed, then power down. Note: Sending a keycode command corresponding to a macro key will echo back only the last keycode of the macro, not the macro key itself, and not the entire string of keypresses the macro represents.

After receiving the keycode echo, bring DTR low again and wait at least 200 msec. To send another keycode command, the entire sequence (wake-up, SEC/SAK, keycode, DTR low, and pause) must be sent.

Sample Code for Programming OFA-5, -6, and -8 Remotes

The following C program functions are designed to demonstrate the process of waking up a OFA remote and sending keycodes to it. They are not intended to be a free-standing program, but rather a model for your own code.

// Turn power on to Serial Interface cable, set DTR high, RTS low

int FAR PASCAL _export cblPwrOn()

if (paddr==- 1) return -1;

outp (paddr+4,OxO 1); // paddr is the serial port address (Ox3F8, Ox2F8, etc.)
return(O)

 

// Test if remote has been sent wake-up code and is ready to receive

// If no response, return -1

// If remote responds, return 0.

int FAR PASCAL export e2On(void)

char Count=0;

char Ch={0};

while (Count<l0)

Delay( 18); putcom( ‘W’); if (comrdyO)

Ch = getcomQ;

if (ch==06)

break;

Count++;

 

if(Ch!= 0x06)

return (-1);

 

putcom(~K’);

return (0);

 

// Send remote a keypress

int FAR PASCAL export e2Send(char val)

putcom(val);

return(0);

Sample Code for Programming OFA- 12 Remotes

The following C program functions are designed to demonstrate the process of waking up a OFA remote and sending keycodes to it. They are not intended to be a free-standing program, but rather a model for your own code.

// Wake up the remote and prepare for sending codes

int wakeup(void)

char Ch;

clock Tmstop;

if (inportb(paddr+4) & OxOl)

outportb(paddr+4,OxOO);

delay( 100);

outportb(paddr+4,OxO 1); outporth(paddr+3,0x43);

delay(300); while (comrdy(ComPort))

getcom(ComPort);

outportb(paddr+3,0x03);

Ch =0;

Tmstop = clockO +18;

while (clockO <Tmstop)

if comrdy(ComPort)

Ch = getcom(ComPort);

if (Ch==~n’)

break;

else

// paddr is the serial port address (0x3F8, 0x2F8, etc.)

// set DTR low

 

// set DTR high

// send BREAK

// hold BREAK for 300 msec

//ComPort is the serial port designation (COM1, COM2, etc.)

I/ignore responses while BREAK is being sent

I/turn off BREAK

// next section waits for WAK // allow 1 second (18 ticks)

 

I/there’s a character waiting

// read it and see if we got a WAK // ‘n’ is character for Ox6E

putcom(Comport,0);

 

if(Ch==n’)

return(O);

I/got WAK back from OFA

else

return( I); // didn’t get WAK back from OFA

 

Customizing Your OFA Remote

All of the OFA remotes allow you to reassign the device keys (such as changing the AUX button to another TV button). This allows the remote to access more than one of each type of device, so you don’t have to constantly reprogram the unit to operate several similar pieces of equipment. The procedure for reassigning the function keys varies by remote.

OFA-5, -6, -8

1. Press and hold the MAGIC button until the LED flashes twice.

2. Press 992.

3. Press the device key you wish to assign a device type to.

4. Press the device key corresponding to the device type you desire.

5. Program the new device key as you would normally.

Example:

To make the AUX1 button to function as CD 185 (Sony), enter the following sequence:

MAGIC* 9 9 2 CD AUX1 MAGIC* 1 8 5

(Note: MAGIC* means to press and hold the MAGIC key until the LED flashes twice.)

OFA-12

1. Program the standard device key as you normally would.

2. Press A B C.

3. Enter 9 9 9.

4. Press the device key of the standard device you just programmed.

5. Press the devce key you wish to assign the function to.

Example:

To make the AUX button function as CD 185 (Sony), enter the following sequence:

CD A B C 1 8 5 A B C 9 9 9 CD AUX

Typically, the IR remote that comes with your audio/video equipment has buttons that are not

found on the OFA remote. These functions are accessed using extended function sequences,

such as MAGIC 662 (OFA-5, -6, -8) or A 1 6 (OFA-12). One of the enhancements in the newer-

style OFA remotes (OFA-5, -6, and -8) is the ability to assign extended functions to any key.

(Unfortunately, the OFA-12 does not have this feature.) You can assign the extended functions

using the following sequence:

1. Press the device key for the device you wish to assign an extended function for.

2. Press the MAGIC key and hold it until the LED flashes twice.

3. Press994.

4. Press the MAGIC key and release it (LED flashes only once.)

5. Enter the extended code for the function you desire.

6. Press the key you wish to assign the function to.

Example:

To assign the extended sequence MAGIC 642 (Intro Scan for our Sony CD 185) to the RCL~

button on the OFA, enter the following sequence:

CD MAGIC* 9 9 4 MAGIC 6 4 2 RCL

(Note: MAGIC* means to press and hold the MAGIC key until the LED flashes twice.)

Commercial Applications

The information provided here can be used to develop software that allows you to use a personal computer to issue IR commands through a connected OFA remote. The Infrared Direct Control program (HAS-4057) is an example of a commercially available program. Perhaps not as obvious is the ability for an inventor/engineer to quickly incorporate infrared control into their product by building the guts of a OFA-6 into it. For $40 (and much less if purchased in large volumes) one can add a sophisticated IR controller with 32K of memory containing one of the largest libraries of IR codes available

 

Getting the Most Out of Your Interfaced OFA Remote

Simply being able to program keystrokes into your OFA remote is quite an accomplishment, but what can you do with it now? It doesn’t really make much sense to move your computer into the livingroom and activate the remote using your mouse when you could have more easily just picked up the remote yourself.

You can get the most benefit out of interfacing your PC to your remote if you have an infrared distribution system. Such a system allows the computer and remote to be tucked away (in a closet, computer room, or other location), and have the infrared signals from the remote distributed to one or several locations around your house. A simple IR distribution system can consist of an X10 Powermid transmitter (HAS-8212) and one or more X10 Powermid receivers (HAS-821 1). The Powermid systems have the beauty of being wireless and are therefore very easy to install. A more elaborate IR distribution system can consist of multiple Powermids or, for the ultimate in convenience and reliability, a network of hard-wired IR sensors and emitters.

With some creative programming, you could schedule your VCR to tape shows for you, not only on the channels your VCR can pick up, but also satellite channels, cable, and pay-TV channels. (Your OFA remote can change the input source on your VCR and select a channel on your cable box or satellite receiver. These functions require your cable box and satellite system to respond to IR commands.)

If you write your program in Windows, you can even get your remote to respond to your voice commands. Imaging sitting down to watch TV and being able to change channels, start or stop your VCR, and adjust the volume all with simple spoken commands! All that is necessary is to have a Sound Blaster (or compatible) sound card, and the Voice Assist software (HAS-9400). You train the Voice Assist program to generate mouse movements and keystrokes that your Windows program already knows and you’re ready to go.

If you have software that allows you to take control of your home computer remotely by modem, such as PC Anywhere or ReachOut, you can imagine being able to call in to reprogram your VCR to tape a show.

Keycode Lookup Table

Function

OFA 5 Code

OFA 6 Code

OFA 8 code

OFA 12 Code

A

01

01

01

29

B

02

02

02

21

C

03

03

03

14

POWER

04

04

04

05

1

05

05

05

26

2

06

06

06

19

3

07

07

07

11

VOL+

08

08

08

03

AUX1

09

09

09

 

VCR

10

10

10

23

TV

11

11

11

31

CABLE

12

12

12

15

4

13

13

13

25

5

14

14

14

17

6

15

15

15

10

VOL

16

16

16

02

AUX2

17

17

17

 

AMP

18

18

18

22

TUNER

19

19

19

14

CD

20

20

20

06

7

21

21

21

24

8

22

22

22

16

9

23

23

23

08

SCAN

24

24

24

 

A/B

25

25

25

46

PLAY

26

26

26

50

AUDIO

28

28

28

21

ENTER

29

29

29

40

0

30

30

30

48

RECALL

31

31

31

56

CH +

32

32

32

33

REWIND

33

33

33

59

PAUSE

34

34

34

51

FF

35

35

35

43

MAGIC

36

36

36

 

CH -

40

40

40

34

SHIFT

41

41

41

 

STOP

42

42

42

52

VIDEO

44

44

44

14

DISPLAY

49

49

49

53

RECORD

50

50

50

37

PROGRAM

51

51

51

38

MUTE

52

52

52

01

SATELLITE

     

07

AUX

     

30

F1

     

62

F2

     

55

F3

     

47

F4

     

39

SLEEP

     

61

 

The serial port control feature of the OFA remotes is not supported by Universal Electronics as a product, therefore the codes above may be changed at any time without notice. If you find that the codes above do not activate the desired keys, the codes may have changed. You will have to try different codes by trial and error to find the new codes. If you are trying to program a OFA remote with a serial port, not in the above list, you will have to find the codes by trial and error.


Home | Forums | Manuals | Files | Infra Red | JP1 Upgrades | Setup Codes | Advanced Codes | Links
The Evolution of Remote Control