By Stuart Mueller
The LEGO RCX is an easily programmable microprocessor packaged with three outputs and three inputs that is built by LEGO. It allows children to create simple programs which they download to the RCX through an infrared tower. The RCX can then be integrated into a LEGO robot which is set free to do the programmed tasks.
The LEGO RCX is great for children, but is not fast enough for more intense data acquisition or more involved calculations. Many microprocessors are now on the market that have the capability to handle higher task loads but are not extremely difficult to program. One of these processors is the PIC processor. Made my Microchip, these chips are relatively well documented and well supported by their manufacturer. Compilers from assembly code, BASIC, or even C++ are available. This processor would provide the desired boost to the RCX.
LEGO RCX PI16F877 Processor
The overall goal of this project is to allow the user to create a simple program using ROBOLAB, the programming language of the LEGO RCX, and have the RCX take that program and write it to the PIC processor. The user will then have the ability to write a program in an extremely simple and visual programming language and still have the power of a PIC microprocessor.
The goal for this semester was to replicate the research done on this topic by high school principal Claude Baumann and then have the RCX write a simple program such as an A/D converter to the PIC. The work done by Claude included the board connecting the RCX and PIC and the programming to the point of being able to read the coding off of a programmed PIC chip.
Over the course of this semester I was successful in replicating the research done by Claude, but was not able to go much further. I am a Mechanical Engineer, and as such, had very little experience with electronic circuits at the beginning of the semester. I was given the circuit diagram from the board made by Claude, but a project that might have taken an electrical engineer the better part of a day to put together took me several weeks. This included time to figure out what all the symbols meant, what specifications were important in ordering each component, and actually wiring the board. It then took me a while to error trap my wiring and get a working board. The test programs for the board are located in an Inventor Library for ROBOLAB on my Programming the RCX page. Once the board passed all of the tests I began to dissect the main code. More information on this is included on the programming page. By the end of the semester I had successfully gotten all of Claude’s programs to work ad had written in the direct mode necessary for the user to send commands. I also was able to receive program data from a previously programmed chip, but was not able to confirm a successful programming from the RCX to the chip. The project is very close to this point. More research needs to be done on how the hex code compiled by MPASM is broken down and sent to the PIC. It was not clear whether data needed to be repeated with the “begin programming only cycle” command included in the “program opcode” path of the main program. Once the break down of the hex code is better understood the user should be able to send programs to the PIC command by command, and then with some programming, as one long code. To get an entire program programmed onto the PIC from the RCX would be a great accomplishment, and would lead to very exciting work testing the computational speed of the PIC and trying to get the RCX and PIC to communicate quickly and seamlessly to enable much more complicated robotic abilities than the RCX ever could tackle.
www.microchip.com - This is the manufacturer of the PIC processor. They have data sheets on all processors plus a great deal of other helpful information.