© Wolfstone, 2005-2007 This file describes the hardware setup used by the controller for the Crate Beast Halloween prop. ' ' -----[ Physical setup ]--------------------------------------------- ' ' Two X-10 Universal modules, for trigger input: ' TrigBeast = PIN7 ' input trigger on P7 ' P7 jumpered for pull-down ' X-10 set to relay only, momentary ' X-10 wired across P7 white and red ' TrigLid = PIN6 ' input trigger on P6 ' P6 jumpered for pull-down ' X-10 set to relay only, momentary ' X-10 wired across P6 white and red ' Two LEDs for diagnostic purposes: ' RedLED = PIN5 ' output debug feedback on P5 ' LED hooked straight to PROP-1 pins, no resistor necessary ' LED between P5 white wire (anode) and black wire (cathode) ' GreenLED = PIN4 ' output debug feedback on P4 ' LED hooked straight to PROP-1 pins, no resistor necessary ' LED between P4 white wire (anode) and black wire (cathode) ' DC-16 Digital Control Board ' jumper address = 0 ' jumper baud rate = 2400 ' AP-8 Audio Player ' jumper address = 0 ' jumper baud rate = 2400 ' Serial I/O communication ' Daisy-chain: Prop-1 -> AP-8 -> DC-16 ' PROP-1 serial I/O on P0 ' ! must bend out pin 8 on ULN2803 chip ' ! add 4.7k pull-up resistor ' ' ----- notes concerning DC-16 Digital Control Board ' ' WARNING: This program is currently written to communicate with a DC-16 ' Digital Control Board, pre-release version "0.3". The real production ' version may be different! ' ' All commands are sent to the DC-16 through a serial link at 2400 baud ' (OT2400 baudmode). ' ' Command syntax: "!DC16", address, cmd {, dataLo, dataHi} ' where ' -- 'address' is %00 to %11 ' -- 'cmd' is a single character ' -- optional 'dataLo' and 'dataHi' are bytes ' ' Valid commands: ' "!DC16", address, "V" ' -- requests version string from DC-16 ' -- should be followed by SERIN to receive three-byte string ' "!DC16", address, "S", newStatusLo, newStatusHi ' -- sets outputs 1 - 8 to 'newStatusLo' ' -- sets outputs 9 - 16 to 'newStatusHi' ' -- a 1 bit = relay on, a 0 bit = relay off ' "!DC16", address, "X" ' -- sets all ports to off ' -- functionally equivalent to: "!DC16", addr, "S", 0, 0 ' "!DC16", address, "P", port, newStatus ' -- sets port (1 - 16, in 'port') to BIT0 of 'newStatus' ' -- 1 = port on, 0 = port off ' -- if 'port' is out of range, command is ignored ' "!DC16", address, "G" ' -- retrieves current ports status ' -- should be followed by SERIN to receive two-byte status value ' (status is sent Little-Endian) ' ' ----- notes concerning AP-8 Audio Player ' ' Command syntax: "!AP8", address, cmd {, dataLo, dataHi} ' where ' -- 'address' is %00 to %11 ' -- 'cmd' is a single character ' -- optional 'dataLo' and 'dataHi' are bytes ' ' The ISD2560 chipcorder holds 60 seconds of audio, addressable ' as 8 segments of 6.4 seconds each. An audio clip may take up ' more than one segment. ' ' For the beast, we will allocate segments as follows: ' segment use ' 0 randomly selected noise ' 1 randomly selected noise ' 2 randomly selected noise ' 3 randomly selected noise ' 4-7 beast attack noise ' ' To play a sound: ' SEROUT Sio, Baud, ("!AP8", AddrAP8, "P", 0) ' play sound 0 ' ' ! After recording AP-8 sounds, select segment 7 = open switches 0, 1, 2 ' ' ----- notes concerning Solenoid Valves ' ' o We are using funky solenoid valves without a return spring. ' Instead, after firing a solenoid, we must fire a _second_ ' solenoid to return to the "resting" state. ' ' o Since the valves are bistable, it is a good idea to remove ' power after every operation is complete. ' ' o After sending a command to the DC-16 Digital Control Board, ' it looks like you have to wait a little before sending the next ' command. Otherwise, it looks like the following command gets lost.