Hi Brent, I have some IR Remote control code that I could share with you that would probably do the job. The code is written in PICC Lite ("C"), runs at 4 MHz with TMR0 overflowing every 1,024 usecs. The I/R receiver input is passed to RB0/INT and on every rising edge, the TMR0 value is saved to determine the length of the High/Low signal that just passed. myke ----- Original Message ----- From: "Brent Brown" To: Sent: Sunday, September 01, 2002 9:14 PM Subject: [PIC]: RF remote control decoding > Hi all, > > I'm interested in talking to anyone who has done decoding of data > from an RF 2 button remote control. I'll skip most of the details and > get down to the problem. > > The data is sent as a combination of short and long pulses. I receive > the pulses OK, and have developed some code that discriminates > between short and long pulses, (approx 500us & 1500us), and > succesfully recognises each button press. It works well, but not well > enough. There is zero tolerance for pulses that are "broken up" > during less than perfect reception. This results in a relatively poor > range of operation. My assumption is that there is still enough of > the pulse getting through that it should still be possible to > identify short and long data pulses. > > I'm using a PIC16F877 with the data from the receiver module coming > into RB0/INT. Presently I interrupt on a rising edge, start a timer, > switch to falling edge and on that interrupt read the timer value > which is the pulse width. > > I have been thinking of all kinds of averaging and integrating > schemes but my brain hurts and I haven't found a workable solution > yet. I would appreciate any helpful suggestions, especially from > anyone that has already been there and done that. > > Thanks, Brent. > > -- > Brent Brown, Electronic Design Solutions > 16 English Street, Hamilton, New Zealand > Ph/fax: +64 7 849 0069 > Mobile/txt: 025 334 069 > eMail: brent.brown@clear.net.nz > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.