I've played around with this a bit. You need to read not only the presence of a pulse, but decode the pulse train as well. Most of the receivers I've seen put out the data output with the carrier removed. This means that either you need to write your software with the timing for a specific model of remote, or you need to have some way of teaching the PIC. (like a learning remote) The former is probably the best way to start. If you find specs on the web, it will let you write receiving code without much trial and error. I made a PIC send codes to my CD player, and the data format was very simple. It was just two bytes, the first being the actual command byte, and the second being the retrograde (bits changed MSB to LSB first, or whatever) of the byte as a checksum. The data rates are usually very low (1000bps) because the carrier is only around 40khz. You'll find that some buttons on the remote, such as volume and channel, send the code repeating over and over, obviously so you can hold down the button. The repetitions are usually fast enough to trigger a scope. You can usually fit the entire message on the screen at once. This will give you a really good idea of what sort of timing you're working with. Andrew On Sat, Apr 17, 2004 at 02:54:11PM +0100, Matt Marsh wrote: > Hi guys, > > For my second PIC project, I'm going to need to detect a button > being pressed on an IR remote control. I've done a small amount of > research on this and from what I've read I'm going to need to hook > up an IR receiver to one of the pins and then time how long pulses > last (and/or the gaps between them depending on the remote). > > So, in order to determine how long a pulse lasts I'm thinking that > I'm going to need to do something like: > > - loop waiting for pin to go high > - reset TMR0 > - loop waiting for pin to go low > - value in TMR0 now contains length of time of pulse > > I just wanted to get some feedback whether I'm thinking of this in > the right way, or whether there is some other technique that is > generally used for timing pulses etc. > > Thanks, > Matt > > -- > Matt N. Marsh > Email: matt@mattmarsh.net Yahoo: marshmn > Web: http://www.mattmarsh.net/ Jabber: mattmarsh@jabber.org > MSN: matt@mattmarsh.net > ICQ: 250467363 > AIM: MattMarshUK > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics