I built a device to decode IR remotes, but I based it on the arduino platform. The same idea applies to the pic though. I use a 555 timer to modulate the output since that was the easiest thing to set up and allows me to just output bits without concern for the modulation. The way I handled the input was multiple receivers tied to one pin. The IR receivers like TSOP models are active low so they go low when they get a signal. I used 3 for the project. One for 36Khz, 38Khz, 40Khz , those are the main remote frequencies. On the output I used 3 different pins depending on what modulation the signal needed. There are ways of doing it with just a micro but this was a lot easier to code and only required a single chip and a couple 555 timer. One problem with directv IR signals is that it sends multiple signals each time you press a button. Even if you have it set for the tv mode, when you press volume up, it first sends a signal for the sat receiver to read ( this is how it detects and displays the message, remote is in tv mode on the screen), it then sends whatever the programmed code is for the tv. You have to separate those out in the code or it will just confuse it as to what the protocol is. This is what the raw output looks like when pressing the some buttons on my directv remote, - is a low, no - is a high, time is in microseconds. UP: Raw (20): -29900 3000 -1150 1250 -1150 650 -550 650 -550 1250 -550 650 -550 600 -1200 1200 -550 1250 -1150 650 DOWN: Raw (20): -29900 3050 -1150 1200 -1200 600 -550 650 -550 1250 -550 650 -600 1200 -550 1250 -1150 600 -550 650 LEFT: Raw (20): -29950 3000 -1150 1250 -1150 650 -550 650 -550 1200 -600 600 -600 1200 -1150 1250 -1150 650 -1150 650 RIGHT: Raw (20): -29900 3050 -1150 1200 -1150 650 -550 650 -550 1250 -600 600 -1150 650 -550 1200 -1150 650 -1150 650 Now notice what happens when I press volume up with the remote programmed for my tv. Raw (20): 14722 6000 -1150 1250 -1150 650 -600 600 -1150 650 -1150 1200 -600 600 -1150 650 -550 1250 -1150 650 Decoded NEC: AF548B7 (32 bits) Raw (68): -16714 9000 -4500 550 -500 600 -550 550 -550 600 -550 550 -1650 600 -550 550 -1650 600 -550 550 -1700 550 -1650 600 -1650 600 -1650 600 -500 600 -1650 600 -500 600 -1650 600 -550 550 -1650 600 -550 550 -600 550 -1650 600 -500 600 -550 550 -550 600 -1650 550 -550 600 -1650 600 -1650 550 -600 550 -1650 600 -1650 550 -1650 600 It sent first a code to the directv receiver to tell it I had pushed a key, then the code to control volume on my brand of tv. I hope this helps. Mark H. Mark Perri wrote: > > If I may ask, how do you have your PIC modulate your signals to > transmit? I'm beginning to build a remote control as well. Do you have > a dedicated port putting out 38 kHz and then another port generating the > codes, which you gate together with external hardware, or do you have > one port doing all the work? > > Mark > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist