I've ported IRR from the 16F84 to the 12F629, thus reducing quite some cost. For those that have built it for the 16F84: Simply replace the 16F84 by the 12F629 as shown in the old board-image, unsolder the oscillation-circuit (crystal and C1, C2) and you're set!
The new file-archive also includes a newer version of the client-application which has few features more.
Nowadays there are quite some home-built IR receivers around, searching on Google yields quite some result.
Most of them send the received pulses "as-is" over the line, which is probably a good idea. I however decided to decode the Sony and Sharp protocols in the PIC itself So if somebody needs an IR-protocol-decoder in a PIC-project this might be of help.
Before you can do anything you will have to find a way to flash code to a 12F629 PIC sold by Microchip (thanks for sending me a free sample!). You might have to build such a programmer yourself, JDM's works for me. ICProg is a very nice programming-tool.
I'm not a pro electrical engineer so if you have any suggestions let me know.
IMPORTANT: The PIC's internal oscillator is used which uses a factory-set calibration-value. Do not overwrite this value! ICProg is smart enough to ask you whether you want to keep the value already stored in the PIC, if you use an application which doesn't do that be sure to backup that value and program it instead of the value already in the hex-file!
|D1||1N4148 (or similiar)|
|IC2||Telefunken TSOP 1740 IR Decoder Module (or similar)|
The circuit is quite simple. On top is the stabilisation-circuit, in the middle there's the PIC and beneath there's the TSOP with a pull-up.
You can test your circuit easily with a terminal-program. If it doesn't work a good point to start is to test whether the supply-voltage is OK (measure at C3), it should be around 5V. Then check if the PIC and the TSOP have supply-voltage.
Incase you want to make a board you can download the Eagle project files beneath.
DTR, GND and RCV refer to the respective RS232-pins, search Google for the pin assignment.
Note: R2 is probably not needed since I've configured the PIC to use the internal pull-ups, I haven't tested it tho because I used the old board.
The current version of the code decodes Sony codes (12, 15 and 20 bit) and Sharp codes. The RS232-communication is at 1200 Bauds, 1 stopbit and no parity. Feel free to add your own decoding routine (RC-5 etc) and send it back to me.
Comments are in german, if you have any questions don't hesitate to ask.
Once the receiver powers up it sends
"OK\r\n" over the line. If you don't receive that something's wrong. :)
As soon as it decodes (and verifies) an IR-command it sends it over the serial line, looking like this:
|2-character manufacturer-code (currently "SY" (Sony) or "SH" (Sharp))|
|Devicecode, 16 bit (little endian)|
|Command, 16 bit (little endian)|
|Chars 0xd (Carriage return) and 0xa (Line feed)|
I've written a small Win32-App that sits in the tray and is able to send messages to other programs and start programs.
It has a configuration file which allows a tree to be constructed. This can be handy if you want to do several things only if a certain key-sequence has been pressed. In my case my PC shuts down if I pull a Mortal-Kombat-Finish-Move-like combo.
A Linux-sample is available, too - it doesn't have any features, it should help you if you want to write something yourself (or port the Win32-app), tho - if you want it contact me.
irr_v2.zip (272Kb), containing