This just happens to be my specialty. Since you only need a short transmission distance, driving the IR LED directly from the PIC port via a 220ohm resistor will give more than sufficient range. The PIC can also be coerced into modulating the LED at 40KHz or so, but you will need to disable interrupts since it is a fairly tight code loop. When programming the '84, one must decide on a suitable timebase. The logical choice is 256 instruction cycles i.e. TMR0 overflow when TMR0 is not prescaled. At 10MHz, this translates to 102.4us. Since most IR control signals operate in bursts of at least 400us, this is an adequate resolution. The longest bursts last for less than 20ms, so a counter (1..255) for the duration of each burst, in 102.4us units, would also be adequate. There needs to be a method of storing the codes. The method I use is to store a sequence of numbers such as 5 10 20 5 13 8 The first number, 5, is a count of the following numbers. Each of the other numbers is a duration count i.e. on for 10 units, off for 20, on for 5 etc. There would always be an odd number of these, since the last state whose duration is recorded should be an 'on' state. I am not directly familiar with the Phillips spec, but most controls I have examined use up to 32 transitions. One Sony control was really complex, with more than 64 transitions per code! Since the 3 different codes you want to store will probably take up more than 64 bytes, you won't be able to store them in the EEPROM. Unless you can find an optimisation (e.g. common starting sequence) then you are pretty much forced to 'hard code' the transition table in the device's program memory i.e. use the retlw table lookup method. Next comes the tricky bit. If you don't have a-priori knowledge of the code timings, then you need an empirical approach. You will need to purchase an IR demodulator module. These have an active low output, with the 40KHz carrier removed. Next, make up a cable to attach to your PC's parallel port. The cable will supply power to the demodulator, and also read its output. Another input pin will supply a steady clock with a period of 102.4us. The PC (in a tight loop, with interrupts disabled) polls the parallel port looking for the timing and IR signals. After a suitable maximum time it exits the loop and displays the results. A bit of extra code can automatically generate a series of retlw instructions suitable for direct inclusion in the rest of your PIC assembler. [Practical note: those IR demodulators require a 0.1uF decoupling cap across the supply. Omission of this has caused me untold grief!] You will notice that most controls repeat a sequence as long as the button is pressed. Your PC program should be smart enough to detect the relatively long breaks between successive transmissions of the same code. You should note the break time (which can range from 20 to 300ms in the controls I tested) and emulate it in the PIC code if necessary. RC-5 codes allready use a bit for 'showing' if the transmission have been breaked. A bit (no. 2 or 3 I think) toggles each time you release and press the button again. Since some devices will not perform the requested function if the code is received only once (especially RECORD), it is best to repeat the same code 3 or 4 times to be sure, to be sure... Now regarding some practical PIC code, I have developed a kit which performs a limited form of IR transmission. Since the code for the kit is public domain (copyright retained by me) I am happy to extract the relevant part for your perusal. Contact me directly, or if enough interest I will post to this list (it's not all that long). This code will directly modulate an LED at 39KHz in chunks of 100us or so. I would like to see this piece of code too... My current project is a universal remote control with lots of added smarts, using a 16C74. If only the !@#$ Parallax software would work! The overriding project aims are to produce a control which looks and feels good, lasts forever, a maximum of 40 large buttons, as easy to use as a toaster, and more intelligence than the average toaster user. Have you found any intelligent way of learning/storing the codes (for each button)? Or do you use a look-up table? Regards, SJH Canberra, Australia Regards Jacob Blichfeldt