If you want to capture these codes with a PIC,
the best way is to use an IR receiver module which receives the IR,
removes the carrier, and outputs the data envelope. I suggest the
Vishay TSOP1100 which works with 33-57kHz carriers. If you also want
to capture the carrier frequency use a photodiode on another pin and,
if your oscillator is at least 8MHz, use PBP's COUNT for 1mS during
the initial IR burst which is usually 2.5mS or longer with almost all
protocols. The initial burst is about 9mS with the NEC protocol. As it
happens, I've posted code to send/receive, encode/decode the NEC
protocol as RF. The only difference for receiving is the polarity -
the IR receiver is active low where an RF receiver is active high. For
sending, modify my RF code with Bruce Reynold's IR code which I cited
earlier. You can even leave it at 40kHz but you'll need to use the NEC
timing in my code. See
http://www.picbasic.co.uk/forum/showthread.php?t=6261.
Bookmarks