$Id: README,v 1.11 2003/08/29 05:43:00 dwalters Exp $ -- Open Automaton Project: http://oap.sourceforge.net -- INPUT MODULE INTRODUCTION ------------------------- This README covers the source code and circuit schematics for the Open Automaton Project Input Module. The Input Module is a hardware device that connects to the PS/2 keyboard socket of a PC motherboard and emulates keypresses when the user presses pushbuttons on the module, or presses the buttons on a separate compatible IR or RF remote control. To the PC, the device just looks like any other typical 102-105 key standard keyboard. The circuit schematic (input_module.sch) was developed in gschem, part of the gEDA package, version 20030525. Circuit schematic symbols that are not in the symbol library bundled with gEDA are included as separate sym files (these .sym files can be copied into your local symbol directory, typically /usr/local/share/gEDA/sym/local/). LICENSING --------- All source code and electronic circuit designs are copyright (C) 2003, Dafydd Walters. The Open Automaton Project software is distributed under the terms of the GNU General Public License. See the file COPYING.SOFTWARE for details. Please see the file COPYING.ELECTRONICS to see the terms under which the electronic circuit designs of the Open Automaton Project are distributed. CIRCUIT NOTES ------------- The circuit is powered directly from the PC motherboard via the keyboard connector (the PS/2 keyboard connector provides a 5 volt supply at up to 100mA; more than enough to power the Input Module). The IR detectors are 3-pin devices designed to operate with a 5 volt supply. They give a Low output signal when IR energy (at around 940nm wavelength) is detected that's being pulsed on and off at a frequency of 40kHz. When there is no IR energy present, or there is IR energy present, but it is not being pulsed at or near the detection frequency of 40kHz, the output signal is High. The circuit has been tested with the IR detectors available from Radio Shack (Radio Shack part number 276-137B). Between zero and four IR detectors may be used. Obviously with no detectors, the Input Module cannot respond to commands from an IR remote control. With four equally spaced around the perimiter of the robot, it should be possible to control the robot via IR remote control whichever way it is facing. The RF receiver module chosen for the Input Module is the RWS-434 from Reynolds Electronics (www.rentron.com). This was chosen because it is simple to use and it is inexpensive. It should be easy to adapt the circuit for use with other RF receiver modules if required; the only requirement is that it can receive a serial bitstream at 1200 baud. The RF receiver is optional. If you don't fit it, then obviously the Input Module will not be able to receive commands from an RF remote control. NOTE: The use of radio frequency and possibly even infrared components may be regulated by some governments. Please check your local laws before using such components. 1/8 watt resistors are fine for R1 through R5. The 0.1uF capacitors are all decoupling capacitors that should be placed near U1, U2 and CONN2 through CONN5. Any momentary action pushbuttons should work in the keypad switch matrix. REMOTE CONTROL COMPATIBILITY ---------------------------- The Input Module firmware has been designed to be compatible with the Sony IR protocol, so most universal remote controls should work fine as long as they are programmed to transmit Sony TV codes (as opposed to Cable, VCR, etc). +Volume = UP -Volume = DOWN -Channel = LEFT +Channel = RIGHT Enter = ENTER Power = ENTER Mute = ESCAPE Pressing a numeric digit button on the remote control sends the corresponding digit keypress. Infrared remote control can be disabled (useful in situations where there may be IR remotes operating nearby and interfering with the robot) by pressing and holding down the [Down Arrow] and [Right Arrow] buttons at the same time for at least 2.5 seconds. Infrared control is re-enabled by holding down the [Left Arrow] and [Down Arrow] buttons at the same time for at least 2.5 seconds. RF remote control is implemented in the Input Module using a custom protocol, so it follows that the transmitter must be custom made. A separate hardware component of the Open Automaton Project, the RF Remote, is such a device. See the directory rf_remote for the full details, including circuit schematic and source code. Each RF Remote Module is programmed to include a Robot ID Code within each transmission, and the Input Module is programmed to respond to one particular code. This Robot ID code is akin to a "channel" selection, and the Input Module is "tuned" to a particular RF Remote module to prevent conflicts when there's more than one robot in the same vicinity using this RF protocol. Setting the Robot ID on the Input Module is performed by holding down a combination of the buttons in the top row of the keypad (the [Escape], [Up Arrow] and [Enter] keys) for at least 2.5 seconds. When used this way, the three buttons in the top row form a 3-bit binary number, with the right hand button being the least significant bit. So for example, to set the Robot ID to 5, you would press and hold down the left and right keys together for at least 2.5 seconds (4 + 1 = 5). To program 3, you would hold down the right two keys, [Up Arrow] and [Enter], (2 + 1 = 3). This technique allows a Robot ID Code in the range 1 to 7 to be programmed (it's not possible to set a Robot ID code of zero). Radio remote control can be disabled (useful in situations where there may be RF sources operating nearby and interfering with the robot) by pressing and holding down the [Right Arrow] button for at least 2.5 seconds. RF control is re-enabled by holding down the [Left Arrow] button for at least 2.5 seconds. The initial default settings of the Robot ID and IR Remote Enabled/Disabled flag are: * Robot ID = 1 * IR Enabled FIRMWARE NOTES -------------- The software for the PIC16F84 PICMicro is written in assembly language, and compiles using the GNU PIC Assembler, gpasm. To compile the source code into a hex file suitable for programming a PIC16F84 device, type gpasm -n input_module.asm The resulting hex file will be called input_module.hex The -n option puts DOS-style CR-LF newline sequences in the .hex file, required by most device programmers. It also compiles with the MPASM compiler for Microsoft Windows that is a part of the MPLAB suite from Microchip. However, you must make sure the assembly (.asm) file is in Windows/DOS format (i.e. with CR-LF sequences at the end of each line) before it will successfully compile in MPASM for Windows. Some device programmers require the configuration bits to be set manually. It is very important that these are set correctly. The Input Module requires the following configuration bit settings: - Code Protection off - Crystal oscillator - Power-Up Timer on - Watchdog Timer off The above settings are represented by the configuration word 3FF1 in hex.