|
...[back] |
Robert D. Poor
Corrections/Additions: Ari Y. Benbasat -- Feb. 2001 |
The need for "Digital Glue"At the MIT Media Lab, we constantly explore new metaphors for interconnecting the physical world and the digital realm. We monitor heart rates for affective computing, display the latest stock quotes for individuals, create new sensors for electronic tags, and build LEGO toys that respond to voice commands. Each of these activities binds some physical process or action to a corresponding digital expression.To simplify this process of binding "atoms" to "bits," the Personal Information Architecture group has created a simple interface device named the "iRX 2.2." The iRX is a circuit card measuring 1.25" × 3" with an RS-232 serial port, a visible LED, an infrared LED, and an infrared detector. At the heart of the board is the PIC16F84A, a nifty little microcontroller made by Microchip Technologies, Inc. The PIC16F84A features thirteen general I/O ports, instruction cycle times of 200 nSec. and an efficient RISC-like instruction set. The iRX 2.1 uses five of the PIC's I/O ports; the remaining eight ports are available for user applications. The total cost of the iRX 2.1 is under $20 US when built in modest quantities.
|
|
About this DocumentThis document is written primarily for anyone who wants to create an interface using the iRX 2.2. It is also useful for anyone who wants to understand the process of developing applications for microcontrollers in general, and for Microchip PIC processors in particular.Here's what you'll find in this document:
|
|
AcknowledgementsThe author gratefully acknowledges help, support and inspiration from the following people. Fred Martin, Brian Silverman and members of Mitch Resnick's Epistemology and Learning Group introduced me to PIC chips and IR emitters and detectors. The design of the iRX 2.1 owes much to the Interface Cricket, one of the many members of the Cricket family designed by Fred and others.Pushpinder Singh and the MIT Robotics and Electronic Cooperative kept things moving through the formative stage of the iRX board. Push volunteered many of his hours to teach our group about PICs and his design for a PIC-based "chord keyboard" helped shape the physical design of the first iRX boards. Randy Sargent provided me with lots of software tools (PIC simulator, Gerber to Postscript converter), code examples, and general inspiration. Encouragement and help from past and present members of the Personal Information Architecture group--especially from professor Mike Hawley, colleagues Maria Redin, Steve Gray, Manish Tuteja and John Underkoffler--has made this a fun project. The first iRX boards were built in April of 1996. Since that time, hundreds of iRX boards have been built and put into various forms of service. Some iRX boards found their way to the top of Mount Everest, others have been stuffed inside plush toys, glued under ping-pong tables, suspended from florescent lights, and one was even concealed in an office chair as part of a "digital whoopee cushion." The author would like to thank everyone, both at the Media Lab and beyond, who has contributed to the success of the iRX project. |
|
|
|
1.0 |
OverviewWhat you get out of the iRX 2.2 depends on what you put into it. It's unlikely that there will be any "pre-canned" configurations that exactly suits your needs--you will generally need to add custom hardware on the board and create a PIC program specifically for your application. But that's the fun part of the process! To give you a taste of what's possible with a PIC and iRX board,
here are some projects that people have created using the iRX 2.2 (or
should
have created):
|
Overview of the Development ProcessThis section briefly describes the steps you'll need to take to create your very own iRX application.Ready...The first step is to make sure you have all the materials at hand. You'll need both some hardware and some software:
Set...It's unlikely that there's any pre-canned firmware for the PIC and iRX 2.1 that will do exactly what you want. Usually, you'll need to write a program for the PIC (or perhaps modify an existing one). In many cases, you'll also be adding components or wires to the iRX 2.1 board.Don't be shy; the iRX was designed to be modified!
Go...Creating and downloading code for the PIC is a five step process, described in the picture and in the text below.
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3.0 |
Building an iRX 2.2This section details the process of building complete iRX 2.2 boards from scratch:
3.1 Fabricate the iRX PC BoardsSince you can't simply go to Radio Shack and purchase an iRX 2.2 (yet), you'll have to have the Printed Circuit (PC) Boards fabricated by a PC Board fabrication shop. Be warned: a shop will charge almost as much to make one printed circuit board as to make 100. When possible, pool your orders to make as many iRX boards as possible at once.3.1.1 Choose a PC Board Fabrication shopThere are many companies that will fabricate PC boards directly from machine-readable design files. See Appendix A for a short list of places that have been recommended.3.1.2 Send the PC Board design filesThe design files for the iRX 2.2 can be found in the design files directory. For PC Board fabrication, the most important file is irx2_2.zip, a single ZIP file that contains all the files a PC Board Fabrication shop will need to make the boards:
Contents of irx2_1pc.zipFor most fabrication shops, all you need to do is send them the ZIP file and a README.TXT file. The README.TXT tells the fabrication shop the particulars of your order - usually just the names of the files and what format/layer they are (as above). Normally, you'll send the files via e-mail or by uploading them on a modem line. In a week or two, you should receive your boards. In the meantime,
you can purchase the components.
3.2 Purchasing the componentsAll of the components, with the exception of the infrared detector and the printed circuit board itself, are available from Digi-Key, a mail-order electronics part supplier. While Digi-Key is not always the cheapest, they have a large selection, take telephone credit card orders, and will get you your parts the next day via FedEx. If you have more time than money on your hands, you may be able to shop around and get a better price on some of the parts shown here.The following lists detail the parts require to build 100 iRX 2.2 boards. The first list specifies components that go on the circuit board. The second list shows ancillary components that are generally useful for complete iRX projects, but are not always required. When possible, I've shown Digi-Key's part numbers and prices (as of February 2001). A more detailed list of parts and alternatives are spelled out in this iRX 2.1 Bill of Materials Spreadsheet (Microsoft Excel format). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bill of Materials for iRX PC Board |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Auxiliary Components for the iRX |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3.3 Soldering the components onto the PC boardSoldering the components onto the iRX board isn't difficult. Assuming you've already had basic experience with soldering, here are some hints:The only components that don't care which way they're inserted are the resistors (R1, R2, R3, R4), the ceramic capacitors (C3, C4), and the ceramic resonator (Y1). For all others, use the silk screen printed on the board as a guide. Note that for each LED and electrolytic capacitor, the longer wire goes in the hole marked with a '+'. To keep components from falling out while you're soldering others (since you have to flip the board over to solder the leads) work from the "shortest" to the "tallest" components in the following order:
Be careful not to overheat the sensitive components during soldering, especially the voltage regulator (U1), the IR detector (U4), and the MAX233 (U2).
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
4.0 |
Developing an ApplicationThe steps towards creating your PIC application are straightforward and have been outlined in Section 2. In this section, we jump into the details.4.1 Not all I/O Ports are created EqualThe PIC16F84 has thirteen ports: RA0 - RA4 and RB0 - RB7. Of these, the iRX 2.2 "reserves" RB0 - RB3 and RB5 for serial and optical inputs and outputs. (Note: you can still use RB0,RB2 and RB4 if you're willing to give up optical inputs and outputs) Some ports have particular traits that may make them more or less suited for your particular application. The following table summarizes the differences; for the full scoop, consult the Microchip data sheets.Except as noted, all ports support TTL levels and are bi-directional under program control.
4.2 C versus Assembly codeWhenever possible, program in C instead of in assembly language. You'll find the development and maintenance of firmware programs to be much faster and easier. However, there are some times when you may still need to program in assembly:
The moral: think three times before you decide you need to write
in assembly code!
4.3 PIC C CompilersWe use PCM, a C compiler by Custom Computer Services. For $99 for a single license or $50/user for a site license, it's a good deal. Contact and purchasing info can be found in Appendix A.4.4 PIC AssemblersWe use MPASM, the free PIC assembler from Microchip. It's a DOS-only application, but has proven to be robust and reliable. Randy Sargent also has a free Unix-based PIC assembler named picasm. See Appendix A for where to find them.4.5 PIC SimulatorsA PIC simulator lets you step through your program, set breakpoints, examine registers; all those things you can't do with a real chip. I've used the simulator built into MPLAB with good results. Randy Sargent has written picsim, a PIC simulator that
runs under Unix. Consult Appendix A for where to find
them.
4.6 Burning your program into the PICThough there are many PIC programmers available, we've settled on the PICSTART Plus programmer from Microchip. You can purchase it via Digi-Key (Universities should ask for the educational discount), and Microchip is good about providing upgrades for the programmer as they introduce new chips.The easiest way to download your program into the PIC is through the PICSTART Plus menus found in MPLAB.
|
|
|
|
App A |
Related LinksPC Design FilesParts Supply Houses
Ollie Ashley Work: 972 276-8244 E-Mail: txcircuitry@att.net 3524 Dividend Drive Garland, TX 75042
|