Mindstorms IR Link PIC tranceiver:


I just finished a half duplex serial asynchronous link from a simple PIC circuit to the RCX. It is able to receive codes from the RCX (or Lego RCX remote control) store them in RAM & EEPROM and transmit any IR op-code to the RCX in turn. Included in the firmware is a routine that takes any opcode(s) and expand it to the proper IR packet for transmission to the RCX. I've used the UIRT circuit with a few modifications for the hardware. The UIRT includes a serial port programmer for the PIC16F84A so you won't need a separate programmer. Here's the website where you can find the programmer.  Here are the modifications to get the UIRT to work with the RCX.

UIRT modifications:

1) connect a jumper from MCLR (PIC16F84A pin 4) to the V+ (+ end of the 100uf capacitor). This keeps the PIC from resetting.

2)Build a 5V power supply. I used a 7805, a 0.1uf cap. and a 9V battery connected across the 100uf capacitor. You could also use a low-dropout regulator such as the TC55RP5000 instead of the 7805 as it uses up much less less power.

3)Bypass the UIRT crystal to ground using two 22pf caps. Connect a jumper across both crystal leads for programming. Remove all jumpers for RCX communications. Look at the site the programmer is on for details.

Of course, you could just use the PIC with the IR LED's and IR receiver and not bother with the UIRT at all. I just happened to have a UIRT around.

Here's the PIC code: RCX.ASM which you can compile on the MPLAB IDE. If you want the compiled code, here it is. If you connect up the modified UIRT with my firmware it will decode each of the Lego RCX Remote Control button commands and send a different set of opcodes to the RCX according to the button pushed. I've tried to comment the firmware but it probably will be hard for anybody to follow my code as I'm fairly new to PIC and RCX hardware.

If anybody has any uses for the PIC-RCX serial link let me know. I'd be interested in your ideas and would be happy to try to make any firmware modifications that would lead to new applications.