H C S 2 - D X Supervisory Controller Technical Manual Release 1.0 8/94 Copyright (c) 1994 Circuit Cellar, Inc. Circuit Cellar, Inc. 4 Park St. Vernon, CT 06066 All rights reserved ***************************** COPYRIGHT ****************************** * * * HCS2-DX, HCS II, XPRESS, PL-Link, IR-Link, LCD-LINK, * * DIO-Link, ADIO-LINK, COMM-Link, DIO+ -Link, HCS-VOICE, * * HCS-DTMF, and MCIR-Link are trademarks of Circuit Cellar, Inc. * * * * This manual is copyright (c) 1994 * * by Circuit Cellar, Inc. * * * * All Rights Reserved * * * * * **************************** DISCLAIMER ****************************** * * * While we have attempted to provide accurate and up-to- * * date information in this manual, Circuit Cellar, Inc. makes no * * representations or warranties respecting its contents. We reserve * * the right to make periodic changes to the text and to issue new * * editions of this manual without notification. * * * * Occasionally in this manual we refer to other manufacturers' * * products. Such references do not constitute an endorsement of * * these products, but are included for the purpose of illustration * * or clarification. We do not intend such technical information and * * interface data to supersede information provided by individual * * manufacturers. * * * * * ********************************************************************** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Conditions of Sale and Product Warranty Circuit Cellar, Inc. and the Buyer agree to the following terms and conditions of Sale and Purchase: 1. Circuit Cellar, Inc. extends the following warranty: a factory- manufactured circuit board or assembly carries with it a one-year warranty covering both parts and labor. Any unit which is found to have a defect in materials or workmanship will, at the discre tion of Circuit Cellar, Inc., be repaired or replaced. 2. A minimum inspection fee must be prepaid for the repair of units that are no longer under warranty. Call Circuit Cellar, Inc. for a current list of fees. 3. Circuit Cellar, Inc. will not be responsible for the repair or replacement of any unit damaged by user modification, negligence, abuse and mishandling, or improper installation. 4. Circuit Cellar, Inc. is not responsible to the Buyer for any loss or claim of special or consequential damages. 5. All units returned for repair must first receive prior autho rization from Circuit Cellar, Inc. A return authorization number may be obtained by phone or letter. Please retain a record of the return authorization number since most subsequent correspondence will refer to this authorization. Under no circumstances should any product be returned to Circuit Cellar, Inc. without such authori zation. Circuit Cellar, Inc. assumes no responsibility for returns unaccompanied by an authorization number. All returns must be shipped prepaid and ought to be insured. Circuit Cellar, Inc. is not responsible for losses or damage during shipment. Repaired units will be returned with postage and insurance paid. 6. Circuit Cellar, Inc. reserves the right to alter any feature or specification at any time. This right extends to fees, charges, and any other conditions or warranties contained herein. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * i ii Table of Contents Description Page _______________________________________________________ 1. Introduction/Specifications . . . . . . . . . 1 2. Getting Started . . . . . . . . . . . . . . . 3 2.1 Quick Setup . . . . . . . . . . . . . . . . 3 HCS2-DX Jumper Settings . . . . . . . . . . 4 3. System Design . . . . . . . . . . . . . . . . 6 3.1 Locating the HCS2-DX . . . . . . . . . . . 7 3.2 Power Supplies . . . . . . . . . . . . . . 9 3.3 Setting Up the Network . . . . . . . . . . 9 3.3.1 Selecting Cable . . . . . . . . . . . . 9 3.3.2 Running Cable . . . . . . . . . . . . . 10 3.4 Analog and Digital I/O . . . . . . . . . . 10 3.4.1 Signal Polarity . . . . . . . . . . . . 11 3.5 X-10 Power-Line Communications . . . . . . 12 3.5.1 Signal Bridging . . . . . . . . . . . . 12 3.5.2 Multiple Transmitters . . . . . . . . . 13 4. HCS2-DX Connectors . . . . . . . . . . . . . . 14 4.1 Power - J12 . . . . . . . . . . . . . . . . 14 4.2 PC Connections - J2 . . . . . . . . . . . . 14 4.3 Network Connections - J1 . . . . . . . . . 15 4.4 Digital I/O - J4 . . . . . . . . . . . . . 16 4.5 Analog Inputs - J7-J11 . . . . . . . . . . 16 4.6 Reset Connector - J3 . . . . . . . . . . . 17 4.7 Vertical Stacking Connectors - J5 & J6 . . 17 Power Table . . . . . . . . . . . . . . . . . . . 18 Silkscreen . . . . . . . . . . . . . . . . . . . 18 Parts List . . . . . . . . . . . . . . . . . . . 19 Schematic . . . . . . . . . . . . . . . . . . . . 21 iii iv 1. Introduction The HCS II is an expandable, network-based, industrial- oriented supervisory control system that, in its minimum configu ration, performs quite suitably as a home control system. The HCS II incorporates direct digital inputs and outputs, analog inputs and outputs, real-time boolean decision event triggering, X-10 transmission and reception, remote displays, telephone line interfacing and text-to-speech functions. The HCS II system architecture consists of a central supervi sory controller, the HCS2-DX, connected up to 31 other functional modules (called Links) via an RS-485 serial network. The HCS2-DX can be used alone with no network modules to facilitate testing or incorporation as an intelligent subsystem in other control equipment. Most of the Link modules share a common 8031 control ler board (generically called a COMM-Link) with the I/O custom ized for each application. The HCS2-DX is quite literally the brains of the system. While each Link has its own processor, each relies on the HCS2-DX for timing, control commands, and overall system coordination. The HCS2-DX is a 9.216 MHz HD64180-based single-board com puter. It has two serial ports, up to 96K bytes of memory (32K is battery backed), an 8-channel 8-bit A/D converter, a clock/calendar, and 24 bits of TTL I/O (an additional 48 bits of buffered I/O as well as other I/O functions may be added if required). These TTL I/O bits may be further conditioned by connecting them to external optoisolators, relays, or drivers. (We strongly recommend you use our BUF-Term buffer board to isolate the TTL I/O bits from the real world.) Depending on your application, the HCS2-DX may be all you need. One of the HCS2-DX's serial ports acts as a dedicated 9600-bps serial RS-485 connection to the various network Link modules. The cable from this port may be up to 4000 feet long (as opposed to 50 feet for RS-232). The second port connects using RS-232 to an IBM PC-compatible computer that functions as the master console. Programs running on the PC allow you to enter, store, compile control programs written in the XPRESS language, and process logged data. The HOST program on the PC acts as a gateway to the HCS2-DX and allows you to load new programs into the HCS2-DX and monitor system status. Once the system is set up and working as expected, the PC may be removed until the next time changes are needed. Besides the HCS2-DX, the HCS II is made up of several spe cial function network modules that facilitate remote data acqui sition, control, and display. With the exception of the ADIO- Link, all Links are based on the COMM-Link generic 8031 board. Each type of Link module has custom firmware and I/O that allow it to take on specific characteristics. The basic COMM-Link board accommodates up to 64K bytes of either RAM, EPROM, or both, and has a single serial port with the option of either an RS-232 or an RS-485 interface. When tied to the network, the RS-485 interface is used. When used alone, the RS-232 interface is normally used. Link modules currently available include the PL-Link, MCIR- Link, LCD-Link, DIO-Link, DIO+-Link, and ADIO-Link. The Pl-Link is a 2-way X-10 interface capable of both transmitting and receiving X-10 commands to and from power-line-base modules. The MCIR-Link allows you to control your HCS II using a trainable hand-held infrared remote control unit. The MCIR-Link can also transmit controls signals to infrared equipped devices such as audio/visual equipment. The LCD-Link provides you with a remote LCD screen and has four push-button inputs. The DIO-Link has eight digital I/O bits while the DIO+-Link has four buffered inputs, four driver outputs and a one channel, 8-bit A/D con verter. The ADIO-Link has sixteen digital inputs, eight digital outputs, eight channels of 8-bit A/D conversion, and four chan nels of 8-bit D/A conversion. Three additional boards are available to add speech and telephone line interface capabilities. These boards piggy-back on top of the HCS2-DX through the use of stacking connectors. The HCS-Voice is a text-to-speech board which can have its output connected to the HCS-DTMF or to an external amplifier so the HCS II system can heard throughout the home. The HCS-DTMF is a tele phone line interface with an on-board DTMF generator. The HCS- DTMF can receive incoming calls, initiate outgoing calls, and generate or received DTMF tones. The HCS-VoiceII board allows you to digitally record and play back up to 6 minutes of audio. The output of the board can be fed into the HCS-DTMF or into an external amplifier. While the HCS II system is already well rounded, we plan to introduce additional boards, like a CEBus interface, in the future. Contact the Circuit Cellar Sales department or log on to the BBS (203/871-1988) for the latest information on boards under development. The HCS2-DX and COMM-Link modules may be powered from either 5 V or 9-18 V. Because of this the HCS II system can be powered off a single power supply. 2. Getting Started If you're like most people, you don't have the patience to read the entire manual before setting the system up to see it work. In order to satisfy your impatience, we've provided quick set up instructions so you can get your system working in just a few minutes. When you're ready to install the system for real, read the remainder of the manual before proceeding. Just a note of warning: Do not make any connections other than the ones we suggest below until after you've read the rest of the manual. Failure to heed this warning may result in damage to one or more HCS II components or to your own equipment. Such damage is not covered under any kind of warranty. 2.1 Quick Setup The minimal setup we assume here is a HCS2-DX, a BUF-Term buffer board, and a PL-Link module. If you have purchased kits, all of these must be assembled and tested according to their respective manuals before proceeding. You should also have a push button or a sensor with a normally open output. - Verify that all the jumpers are installed on the HCS2-DX in their factory default positions as shown on the next page. Likewise, make sure the jumpers are set on the PL-Link and BUF-Term as shown in their manuals. - Connect the 26-pin ribbon cable between JP1 on the BUF-Term board and J4 on the HCS2-DX. Pay close attention to the location of pin 1 when plugging the cable into each board. - Connect the sensor or push button to the screw terminals labeled A0 on the BUF-Term board. The BUF-Term board should have resistor pack SIPA1 installed. - Make sure your power supply is off and connect it to the power terminals on the HCS2-DX (J12). The positive side should go to the pin labeled V+ while ground should go to Gnd. The supply should be in the range of 9-18 V. If your board has R8 installed then you must use a 5 V power sup ply. Powering the board with a voltage greater than 5 V will damage it. Damage caused by an incorrect power supply voltage is not covered under warranty. - Similarly, connect the 9-18 V power supply to the power terminals on the BUF-Term (T1, V+, and GND) and on the PL-Link (T2, V+, and GND). HCS2-DX Jumper Settings JP1: None JP4: 1,2 JP2: 1,2 JP5: 1,2 JP3: 3,4 JP6: 1,2 and 3,4 J3: None JP7: Not installed ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ J7 J8 J9 J10 J11 ³ ³ ÉÍÑÍËÍÑÍËÍÑÍËÍÑÍËÍÑÍ» ³ ³ ÈÍÏÍÊÍÏÍÊÍÏÍÊÍÏÍÊÍÏͼ ³ ³ ³ ³ ³JP6º ³ ³ º ÍÍÄÄ1 JP7 ³ ³ 1 JP3 Ä + ³ ³ 1ºJP2 ÉÍ» ³ ³ ³ ÇĶ J1 ³ ³ JP4 Èͼ ³ ³ ³ JP1ÄÄ - ³ ³ º ³ ³ 1 JP5³ ³ ³ 1º ³ ³ ³ ³ ³J3 ³ ³ 1 Ú¿ ³ ³ ³³ ³ ³ ³³ ³ ³ ³³ ³ ³ Ú¿ J2ÀÙ1 ³ ³ ³³ Ú¿ ³ ³ ³³ ³³ HCS2-DX ³ ³ ³³ ³³ ³ ³ ÀÙ1 ³³ ³ ³ J6 ÀÙ1 ÉÍÑÍ» ³ ³ J5 ÈÍÏͼ ³ ³ ÚÄÄÄÄÄÄ¿1 J12 ³ ³ ÀÄÄÄÄÄÄÙJ4 Gnd V+ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - Connect a pair of wires between T1 on the PL-Link and pins 1 and 2 of J1 on the HCS2-DX. Pin 1 should go to the "+" on the PL-Link and pin 2 to should go to the "-". Making this connection backwards won't damage anything, but the network won't work right. - Plug one end of the modular telephone cable into the phone jack on the PL-Link. - Plug the other end of the same telephone cable into the TW523 and plug the TW523 into a wall outlet. - Set up an X-10 lamp module for housecode L, unit 1. Plug the module into an outlet and plug a lamp into the module. Similarly, set up another lamp module for L2 and plug it in with a second lamp. Be sure the lamps are turned on. - Connect a serial cable between J2 on the HCS2-DX and COM1 on a PC-compatible. Be sure pin 1 on the serial cable matches the pin 1 location on the connector on the board. J2 is a 16-pin Berg-type header so an adapter will be needed. Circuit Cellar offers such an adapter as part number DB25S-16O or you may construct your own. - Double check ALL power connections to ensure nothing is wired backwards (especially the HCS2-DX power connections). - Finally turn the power supply on. The LED on the PL-Link should blink slowly. The LED on the HCS2-DX will stay off until a program has been downloaded to it. Type the sample program shown below into a plain text file on your PC using a text editor or a word processor in text-only mode. In some word processors, you must make a special effort to request that the program save your file as plain ASCII text. Call the file EVENTS.HCS. Be sure your word processor does not add any extra control characters or formatting commands. ! ! Sample HCS II control program ! CONFIG SC = SC1 CONFIG PL-LINK = 1 Display Modules = L DEFINE Sensor = Input(0) DEFINE Lamp1 = Module(L1) DEFINE Lamp2 = Module(L2) DEFINE LampDelay = Timer(1) BEGIN IF Sensor=ON THEN Lamp1 = ON END IF Sensor=OFF THEN Lamp1 = OFF END IF Sensor=EDGE AND Sensor=ON THEN Lamp2 = ON LampDelay = ON END IF LampDelay>=5 THEN Lamp2 = OFF LampDelay = OFF END The program simply watches the input and turns the first lamp on when the input goes on, then off when the input goes off. It also turns the second lamp on when the input goes on, but turns the lamp off five seconds later regardless of the state of the input. When you're done creating the file, exit the text editor and type COMPILE. The XPRESS compiler will check your program for proper syntax and will create a binary equivalent called EVENTS.BIN. If COMPILE finds any typing errors, fix them and compile the program again. After a successful compile, type HOST to enter the host program. You should get a screen full of windows that display various system stats information. Press the "T" key to set the HCS2-DX's time and date. Then press the "L" key to load your compiled program into the HCS2-DX. When HOST tells you the load is successful, your program is running and should respond to your sensor or push button as described above. If HOST tells you that the HCS2-DX isn't responding to either the T or L command, there is probably a problem with the serial connection between your PC and the HCS2-DX. Double check all connections. The PL-Link must also be active for any X-10 commands to be sent to the power line. Make sure the Network Module window shows a "*" next to the PL-Link label. If either "-" or "E" show up, double check your network connections. Your HCS II is now operational. Feel free to experiment by modifying the sample program for other behaviors. Be sure to recompile the program each time you make a change. When you're ready to begin installing the system for real, read the rest of this manual before making any more connections. 3. System Design The HCS II provides you with an incredible amount of flexi bility in how you set your system up. We recommend you take some time to consciously design your overall system rather than ran domly run wires and make connections. Take a few moments to think about how you want your system to operate. Will simple X-10 power-line control meet all your control needs, or will you need to run some wire? X-10 signals travel over existing power lines, so additional wire isn't necessary. While the X-10 system is perfect for turning lights on and off, it can be somewhat unreliable and slow for other types of communication such as sending sensor status back to the HCS2-DX. If you want to run wire for motion detectors, magnetic switches, temperature sensors, and so forth, where are those sensors going to be located? It's always a good rule of thumb to run twice as much wire as you think you'll need. Eight-conductor (four twisted pair) cable is a good choice if your pulling wire anyway. You may also be able to run a group of sensors back to a single DIO-Link or ADIO-Link, requiring just one twisted pair to be run back to the SC. For example, if you have three bedrooms grouped at one end of the house, you could run all the sensors from those three rooms back to a single DIO-Link located centrally to the rooms. How fast a turnaround do you need in response to a sensor input? Responses to sensors connected directly to the HCS2-DX are almost instantaneous when controlling an output connected directly to the HCS2-DX. Inputs and outputs traveling across the network will slow the response down a bit. For example, in a typical setup, sending out an X-10 command in response to an input on the HCS2-DX may take half a second, but turning on an output on a DIO-Link may take up to two or three seconds. Sensors that require an immediate response should have wires run back to the HCS2-DX for direct (or local) connection. An example of such a sensor might be a motion sensor at the top of a stairway. How useful is a light that doesn't come on until you're halfway down the stairs? On the other hand, a 1- or 2-second delay won't make any difference if you're sounding a chime in response to a car in the driveway. 3.1 Locating the HCS2-DX The HCS2-DX should be located in a central location close to an AC outlet (ideally near the fuse box or breaker panel). Easy access to a telephone line will also be necessary if you plan on using the HCS-DTMF board. If these services are not presently available in the area you plan to install the system, we strongly suggest you contact a qualified professional to install and test them for you. The area must be free of any obstructions such as HVAC venting, plumbing fittings, electrical conduits, steam systems, or any other manner of building systems. In general, make sure you will have enough room to safely work on the system. The HCS2-DX must also be kept a safe distance from heaters, fans, blowers, motors, water heaters, or other major systems. It is important to remember that the HCS2-DX, and it associ ated units, is an electrical appliance designed for indoor installation. It must not be mounted where it will be "normally" subjected to extreme environmental conditions. Your HCS2-DX will have a much longer life if it is kept clean, dry, and within its operating limits. All components in the HCS II system are rated for a 0-70øC (32-158øF) temperature and a 10-90%, noncondens ing, relative humidity operating range. Many people prefer to mount a sheet of plywood on the wall in the basement or garage where the SC is to be installed. The SC may be mounted on the wood at chest level to make working on it easy. Additional expansion boards that are located nearby (such as a PL-Link) may also be mounted right on the wood. Buffer boards and connector strips are easy to mount and make running wires from place to place clean and easy. Alternatively, you might mount the HCS2-DX and any buffers and connectors inside a standard metal alarm-type box with a door on it. This method can offer more protection from the environ ment than simply mounting on a piece of plywood. Don't forget you'll need to connect a PC to the HCS2-DX for programming, so there should be either a PC nearby, a portable PC (such as a laptop) available, or a serial cable run from the SC to your PC. Keep in mind that if you run a cable for an RS-232 connection, the cable should be less than 50 feet long and kept away from noise sources like blower motors, oil burner trans formers, and power lines in general. Since every installation will be different, this manual cannot address the selection of hardware (concrete screws, wood screws, etc.) that you will use for mounting the system. Nor can the manual make any specific recommendations or provide any guidance concerning the methods for applying the hardware at your site. We also cannot provide guidance on what may be considered a "safe location" at your site. If you require assistance with these or other topics related to mounting the HCS II system, you are advised to contact a state licensed contractor or electri cian. We also cannot provide guidance on the use of tools (drills, impact drills, hammers, saws, etc.) that may be required to complete the mounting operation of the HCS II system. If you need assistance or instruction in the use of any tool that you will use during the installation, please refer to the operator's guides provided with those tools for further information on their safe and proper use. 3.2 Power Supplies All the boards in the HCS II system will accept any DC vol tage between 9 and 18 V. A single power supply may be used to power the whole system, or separate power supplies for each Link board may be used. Please note that if R8 is installed in your HCS2-DX then the board can only be powered from 5 V. If this is so then the HCS2-DX will need to be supplied by the 5 V output of the BUF-Term board. If you elect to use a single power supply for the system, you might run the power in the same cable as the main network to make powering network modules easy. In such a setup, you'd have to run at least four-conductor (two twisted pair) cable to each node location. Be sure to allow about 200 mA at 12 V for the HCS2-DX and BUF-Term combination, plus an additional 200 mA for each COMM-Link module on the network. For an example setup consisting of a HCS2-DX, BUF-Term, and three COMM-Links, your power supply should be capable of supply ing at least 400 mA at 12 V. In such a case, it would be prudent to make sure the supply is good for at least 1 to 1.5 A to allow for future expansion. The memory on the HCS2-DX is battery backed, so in the event of a power failure, your XPRESS program won't be lost. When power is restored, the HCS2-DX will continue to execute your XPRESS program as if power had never been lost. Be aware, how ever, that other devices in the house that aren't battery backed (such as X-10 modules) may need to be manually reset after a power outage. 3.3 Setting Up the Network In a very basic HCS II setup where only a HCS2-DX is used with direct inputs and outputs, a network isn't necessary simply because there aren't any network modules to connect. In an only slightly more complicated system where the only network module is a PL-Link, all that's really necessary is a 6-inch piece of cable to connect the PL-Link to the HCS2-DX. No additional cable needs to be run and the wiring to the PL-Link can be virtually any thing. In systems where the network extends beyond six inches, some care must be taken when selecting and running the cable to ensure error-free operation of the network. 3.3.1 Selecting Cable The most important factor in selecting a cable is to be sure it contains twisted pairs. Most common 4-conductor telephone cable runs the wires in parallel and is not suitable for use in this system. The minimum cable must contain two twisted wires (a single twisted pair). The wires may be solid or stranded and are typically 22 gauge down to 26 gauge. If you are running power to the modules, then cable with two twisted pairs (four wires) is necessary. If you're installing new cable anyway, we recommend you run cable with at least four twisted pairs (eight wires) to account for expansion. The emerging CEBus home automation stan dard also calls for four-twisted-pair cable, so you'll be ready for future CEBus devices as well. 3.3.2 Running Cable The network topology is left up to you to decide. A single cable run may be made throughout the house, where the cable starts at the HCS2-DX, then goes from one room to the next. This configuration is the easiest to run and requires the least amount of cable. A problem with this approach is the possibility that a wire in the cable could break somewhere in the middle of the run, cutting off all devices downstream of the break from the rest of the system. The alternative we recommend is to run separate cables from the HCS2-DX to each room in the house. Some larger rooms may require multiple cable runs. While this approach takes more time in the beginning and requires more cable, it offers a good deal more flexibility, and troubleshooting is easier when you can isolate individual rooms. As above, CEBus specification calls for separate cable runs from a central location to each room, so you're once again preparing for the future in more ways than one. You may also find it easier to connect sensors directly to the SC if you run separate cables to each room. For example, if you run four-twisted-pair cable to each room, you can use two of the pairs to carry the network and power to, say, a DIO-Link that has window and door sensors tied to it, and the two other pairs to carry contact closures from a pair of motion detectors back to the HCS2-DX for direct connection. When installing the network cabling, be sure the cable is at least six inches away from any AC power cable. Never install network cable in the same conduit as AC power-line cable. If the network cable must cross the path of an AC cable, be sure the two paths cross at right angles. 3.4 Analog and Digital I/O The digital I/O ports of the HCS2-DX, LCD-Link, DIO-Link (V1.0), DIO+-Link, and ADIO-Link are low-current, TTL-compatible ports. In almost all installations, additional buffers and drivers are necessary when making connections to these ports. Under no circumstances should the ports be used (when configured as outputs) to drive lamps, relays, bells, or other devices directly. Sensors may be connected directly to the ports when used as inputs, but extreme care must be taken to ensure the voltage on the inputs doesn't drop below 0 V or go above 5 V. In order to protect your HCS2-DX hardware, we strongly advise the use of our BUF-Term parallel buffer board. Each input buffer on the board can withstand voltages from -30 V up to +30 V and each output driver can handle 500 mA at 50 V (with 20% duty cycle) or 175 mA at 50V (with 100% duty cycle). Similar precautions must be taken when dealing with the analog I/O on the HCS2-DX, DIO+-Link, and ADIO-Link. The analog inputs must be constrained to a range of 0-5 V, while the outputs must be buffered before they can be used to drive any device. Because the requirements of an analog interface are usually different for every installation, we currently don't have any off-the-shelf analog buffer boards. Be sure to contact Circuit Cellar technical support if you're at all unsure about how to make analog connections in your application. Damage to boards caused by unbuffered inputs or outputs is not covered under warranty! Refer to the individual hardware manuals for details on connector pinouts and interface limitations. Appendix B of the XPRESS manual lists the ports on each of the boards; whether they are assigned to be inputs, outputs, or both; and how they are referenced from within an XPRESS program. 3.4.1 Signal Polarity In the XPRESS language, an unbuffered digital input or output at 0 V is considered OFF while an input or output at 5 V is considered ON. Buffers and interface circuitry may ultimately invert inputs or outputs so the ON and OFF labels end up reversed. For example, a simple transistor driver on an output driving a light may work by turning the light on when the output goes to 0 V and off when the output goes to 5 V. In such a case, the XPRESS statement "Output(x) = ON" would actually turn the light off. Similarly, a normally open contact closure might have one contact connected to ground while the other contact is connected to a system input with a pullup resistor. When the sensor is inactive (or open), the input is going to read ON. When the sensor closed and grounds the input, the input is going to go OFF. You must take all such polarity reversals into account when writing your program. To make a program easier to read, you might use the following definitions: DEFINE OnN = ON ! Normal "on" state DEFINE OffN = OFF ! Normal "off" state DEFINE InI = OFF ! Inverted "on" state DEFINE OffI = ON ! Inverted "off" state For all inputs and outputs that use normal (or noninverted) states, you would use the "OnN" and "OffN" pair in your program. For inputs and outputs that get inverted by buffers, the "OnI" and "OffI" pair is used. 3.5 X-10 Power-Line Communications The X-10 system communicates without additional wiring by sending messages through the home's power lines. The world of AC power was never designed for data and is a harsh, difficult environment in which to send packets of information. While the vast majority of X-10 installations work flawlessly, an number of factors in the home can combine to make such communication unre liable in some cases. 3.5.1 Signal Bridging If you find you can control some X-10 modules reliably, but can't reach other, you're probably having trouble communicating between 110 V legs. Power enters the house through three wires: two "hot" wires and one neutral wire. The voltage between the two hot wires is 220 V, while the voltage between either hot wire and the neutral wire is 110 V. Appliances such as electric stoves and clothes dryers that use 220 V are connected to both hot wires. The rest of the house is usually wired so that half the outlets are con nected to one hot wire and the other half are connected to the second hot wire. X-10 transmissions that originate on one hot wire (or "leg") usually must exit the house, go all the way to the pole on the street, then back to the house to get to the other leg. Most of the time the data packet won't survive such a trip and is lost. The electric stove and clothes dryer mentioned above can often provide a shortcut between legs so the packet can get across, but the shortcut is only there when the appliance is on. Leviton Manufacturing makes a "signal bridge" module which can be installed in the fuse box or breaker panel, that provides a continuous path for packets to travel from one leg to the other. Contact Circuit Cellar for information on how to obtain this module. We recommend only a qualified electrician install this device. 3.5.2 Multiple Transmitters If you find that commands sometimes don't get through when you're using an X-10 manual control unit, your commands may be colliding with those being sent by the HCS II. When a group of people are talking and two speak at the same time, understanding what either said is usually impossible. Similarly, when the HCS II is transmitting and you try to transmit at the same time, both messages are usually lost. Unfortunately there isn't much that can be done (short of you never using a manual X-10 controller). In most installations, the HCS II is transmitting very seldom, so the chances of a collision are low. If you leave X-10 refresh turned on, your chances of a collision are much greater. In general, if you leave refresh off when you're home, and only turn it on when you're away, collisions shouldn't be a problem. 4. HCS2-DX Connectors 4.1 Power - J12 The HCS2-DX requires a minimum of 150 mA at +9-18V. Power goes to J12 as shown below. Be sure to double check your connec tions before applying power to the HCS2-DX! It is very easy to connect the power to J12 backwards. Boards damaged by incorrect power connections are not covered under warranty. ³ Q2 ³º ³ ³º ÚÄÄÄÂÄÄÄ¿ ³ ³º ³ O ³ O ³ ³ ³º ÃÄÄÄÅÄÄÄ´ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙº ÀÄÄÄÁÄÄÄÙ º J12 º Gnd V+ º ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ If you plan to connect an RTC-BUFIO or RTC-BUF50 board to your HCS2-DX, you may attach power to the connector on one of these boards instead. Be sure to follow the hook-up instructions supplied with the RTC-BUFIO and RTC-BUF50 boards to ensure noth ing is connected backwards. When plugging the RTC-BUFIO board (or any stacking board) into the HCS2-DX, be sure to line the keys up properly. Plugging a board into the HCS2-DX backwards may damage the board. A board damaged by plugging it in backwards is not covered under war ranty, so exercise appropriate care. 4.2 PC Connections - J2 Any IBM PC-compatible computer may be used as a console device for the HCS II. The PC acts as a host on which control programs are written, compiled, and transferred to the HCS2-DX. The PC will also display system status during setup and check out. Once the system is working, the PC may be removed or left connected for data logging. The HCS2-DX has a 16-pin Berg-type header (J2) used to con nect with the PC. An adapter cable that goes from the Berg header to a standard DB25 is useful for making the connection. Circuit Cellar sells such a cable as part number DB25S-16O. If you'd prefer to construct one, please refer to the pinout on the following page. With the adapter in place, a straight-through DB25-to-DB25 cable may be used to connect the PC to the HCS2-DX. The SC may be plugged into either COM1 or COM2 of the PC. The HOST program defaults to COM1. RS-232 21ÚÄÄÄÂÄÄÄ¿8 ³ O ³ OÄÅÄÄ 8 - pulled up to +12 V ÃÄÄÄÅÄÄÄ´ pulled up to +12 V - 20 ÄÄÅÄO ³ OÄÅÄÄ 7 - Gnd ÃÄÄÄÅÄÄÄ´ ³ O ³ OÄÅÄÄ 6 - pulled up to +12 V ÃÄÄÄÅÄÄÄ´ ³ O ³ OÄÅÄÄ 5 - pulled up to +12 V ÃÄÄÄÅÄÄÄ´ ³ O ³ OÄÅÄÄ 4 - Clear To Send ÃÄÄÄÅÄÄÄ´ ³ O ³ OÄÅÄÄ 3 - Transmit Data ÃÄÄÄÅÄÄÄ´ ³ O ³ OÄÅÄÄ 2- Receive Data ÃÄÄÄÅÄÄÄ´ ³ O ³ O ³ 14ÀÄÄÄÁÄÄÄÙ1 J2 4.3 Network Connections - J1 When using any COMM-Link modules, a network must be installed using twisted-pair wire. Please refer to sections 3.3.1 and 3.3.2 for more information about selecting and running cable. When making the network connection to the HCS2-DX, the con nection's polarity is important. The positive network wire must go to pin 1 of J1 (marked "+"), while the negative network wire must go to pin 2 (marked "-"). Making this connection backwards won't damage anything, but the network won't work properly. The following shows how this connection should be made: ³ RS-485 ³ + ³ ÚÄÄÄÂÄ¿ ³ ³ OÄÅÄÅÄÄÄÅÄÄÄÄ + ÃÄÄÄÅÄ´J1 ³ RS-485 Network ³ OÄÅÄÅÄÄÄÅÄÄÄÄ - ÀÄÄÄÁÄÙ ³ - ³ ³ ³ Edge of board 4.4 Digital I/O - J4 The HCS2-DX has 16 inputs and 8 outputs on J4 that are TTL compatible. Any signals connected to these I/O bits must be kept in a range of 0-5 V and may not draw more than a few milliamps of current. We strongly recommend that no connections be made directly to these bits, but that such connections be made through appropriate buffers. Damage to the board caused by unbuffered signals is not covered under warranty. The BUF-Term buffer board is a good way to buffer all the inputs and outputs. The following figure shows the pinout of J4: O O O O O O O O I I U U U U U U U U I I N N G T T T T T Y T T N N 1 1 n O 1 2 3 4 5 6 7 8 9 0 1 d 25ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿1 ³ o ³ o ³ o ³ o ³ o ³ o ³ o ³ o ³ o ³ o ³ o ³ o ³ o ³ ÃÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄ´ J4 ³ o ³ o ³ o ³ o ³ o ³ o ³ o ³ o ³ o ³ o ³ o ³ o ³ o ³ ³ 26ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ2 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ I I I I I I I I I I I I G N N N N N N N N N N N N n 0 1 2 3 4 5 6 7 1 1 1 1 d 5 4 3 2 4.5 Analog Inputs - J7-J11 The HCS2-DX also has eight channels of 8-bit A/D conversion. Signals connected to these channels must be kept in the range of 0-5 V. Similar to the digital I/O, we recommend the use of buffers to ensure signals going into the ADC stay within a safe range. Damage to the board caused by unbuffered signals is not covered under warranty. In7 In6 In5 In4 Gnd Gnd In3 In2 In1 In0 J7 J8 J9 J10 J11 ÉÍÍÍÑÍÍÍËÍÍÍÑÍÍÍËÍÍÍÑÍÍÍËÍÍÍÑÍÍÍËÍÍÍÑÍÍÍ» ÇÄÄÄÅÄÄÄ×ÄÄÄÅÄÄÄ×ÄÄÄÅÄÄÄ×ÄÄÄÅÄÄÄ×ÄÄÄÅÄÄĶ º O ³ O º O ³ O º O ³ O º O ³ O º O ³ O º ÈÍÍÍÏÍÍÍÊÍÍÍÏÍÍÍÊÍÍÍÏÍÍÍÊÍÍÍÏÍÍÍÊÍÍÍÏÍÍͼ Note that Inx corresponds to the XPRESS keyword ADC(x). Therefore, ADC(5) in XPRESS would read the value of the signal connected to In5. 4.6 Reset Connector - J3 The HCS2-DX has a 2-pin connector used to reset the board. You shouldn't ever need to reset the system, but you may want to install a push button while you're setting everything else up. Just plug a standard normally open push button into connector J3. When the button is pressed, the HCS2-DX will reset and continue as if power had been removed and reapplied. ÚÄÄÄ¿ ³ O ³ ÃÄÄÄ´ Reset ³ O ³ J3 ÀÄÄÄÙ 4.7 Vertical Stacking Connectors - J5 & J6 The HCS2-DX has two vertical stacking connectors which are used to connect expansion boards such as the HCS-Voice, HCS-DTMF, and BUFIO boards to the HCS2-DX. Please note that these connec tors are for electrical connections and not intended for mechani cal support. Whenever a board is stacked on top of the HCS2-DX it should be secured with nylon standoffs. 26ÚÄÄÄÂÄÄÄ¿25 26ÚÄÄÄÂÄÄÄ¿25 -12V³ O ³ O ³GND D4³ O ³ O ³D3 ÃÄÄÄÅÄÄÄ´ ÃÄÄÄÅÄÄÄ´ TOUT³ O ³ X ³GND D5³ O ³ O ³D2 ÃÄÄÄÅÄÄÄ´ ÃÄÄÄÅÄÄÄ´ E³ O ³ O ³GND D6³ O ³ O ³D1 ÃÄÄÄÅÄÄÄ´ ÃÄÄÄÅÄÄÄ´ \BWR³ O ³ O ³GND D7³ O ³ O ³D0 ÃÄÄÄÅÄÄÄ´ ÃÄÄÄÅÄÄÄ´ \RD³ O ³ O ³GND +5V³ X ³ O ³+5V ÃÄÄÄÅÄÄÄ´ ÃÄÄÄÅÄÄÄ´ \RD³ O ³ O ³GND A4³ O ³ O ³A3 ÃÄÄÄÅÄÄÄ´ ÃÄÄÄÅÄÄÄ´ \NMI³ O ³ O ³\INT1 A5³ O ³ O ³A2 ÃÄÄÄÅÄÄÄ´ ÃÄÄÄÅÄÄÄ´ \INT0³ O ³ O ³\INT2 A6³ O ³ O ³A1 ÃÄÄÄÅÄÄÄ´ ÃÄÄÄÅÄÄÄ´ RESET³ O ³ O ³GND A7³ O ³ O ³A0 ÃÄÄÄÅÄÄÄ´ ÃÄÄÄÅÄÄÄ´ ³ O ³ O ³ +5V³ O ³ O ³+5V ÃÄÄÄÅÄÄÄ´ ÃÄÄÄÅÄÄÄ´ ³ O ³ O ³ \C000³ O ³ O ³\A000 ÃÄÄÄÅÄÄÄ´ ÃÄÄÄÅÄÄÄ´ ³ O ³ O ³ \E000³ O ³ O ³ ÃÄÄÄÅÄÄÄ´ ÃÄÄÄÅÄÄÄ´ ³ O ³ O ³ +12V³ O ³ O ³\RD 2ÀÄÄÄÁÄÄÄÙ1 2ÀÄÄÄÁÄÄÄÙ1 J6 J5 X = Key Power Table IC# Type +5V GND U1 HD64180 34 18,36 U2,U3 74LS245 20 10 U4 SN75176 8 5 U5 MAX232 16 15 U6 NMC9346 8 5 U7 MC34064 2 3 U8 74LS14 14 7 U9-U11 27256/62256 28 14 U12 74LS32 14 7 U13 74LS139 16 8 U14 74LS25 14 7 U15 DS1215 16 8 U16 8255A-5 29 8 U17 ADC0808 11 13 Silkscreen HCS2-DX Parts List ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Part # Part type/value Description ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ PCB1 Printed Circuit Board ICs U1 HD64180 Microprocessor (68-pin PLCC) U2,U3 74LS245 Octal Bus Transceiver U4 SN75176B RS-422/RS-485 Transceiver U5 MAX232 RS-232 Driver/Receiver U6 NMC9346 1024-bit EEPROM (Optional) U7 MC33064 Power Fail Indicator (TO-92) U8 74LS14 Hex Inverter w/ Schmitt Trigger U9 27256-20 32K EPROM (HCS2DX Firmware) U10 27256-20 32K EPROM/SRAM (optional) U11 62256-15 32K SRAM U12 74LS32 Quad 2 Input OR Gate U13 74LS139 Dual 2-to-4 Decoder U14 7425 Dual 4 Input NOR Gate w/ Strobe U15 DS1215 Phantom Time Chip U16 8255 Programmable Periph. Int.(PLCC) U17 ADC0808 8-Channel, 8-bit A/D Converter Capacitors C1,C2 10 pF Monolithic, 50 V C3-C7, C10 10 æF Tantalum, 16 V C8, C11-C27 0.1 æF Monolithic, 50 V C9 47 æF Electrolytic, Radial, 25 V Resistors (¬-Watt, 5% carbon film unless otherwise noted) R1 470k ohm yel-vio-yel R2 100 ohm brn-blk-brn R3 470 ohm yel-vio-brn R4, R7 10k ohm brn-blk-org R5 1M ohm brn-blk-grn R6 560 ohm brn-org-red R8 0 ohm blk (only installed for 5 V operation only) RN1 4.7k ohm (472) Resistor Network, 9-element (4K7) Sockets SK1 68-pin PLCC Socket SK2, SK3 20-pin DIP Socket SK4,SK6 8-pin DIP Socket SK5, SK13, SK15 16-pin DIP Socket SK8, SK12, SK14 14-pin DIP Socket SK9-SK11, SK17 28-pin Socket SK16 44-pin PLCC Socket Connectors J1, J7-J12 Terminals 2-Position Screw Terminal J2 2x8 Header Berg-type Pin Header J3 1x2 Header Berg-type Pin Header J4-J6 2x13 Header Berg-type Pin Header Jumper Headers JP1 1x2 Header Berg-type Pin Header JP2,JP4,JP5 1x3 Header Berg-type Pin Header JP3 1x4 Header Berg-type Pin Header JP6 1x5 Header Berg-type Pin Header Miscellaneous D1 1N4004 Diode D2, D3 1N914B Diode LED1 TIL220 Light-Emitting Diode POT1 10k ohm Trim Pot Q1 2N2907 PNP Transistor Q2 LM7805C 5 V Voltage Regulator XTL1 18.432 MHz Crystal, HC-49/US, Low Profile XTL2 32.768 kHz Crystal, Canister Style Z1 LM336Z-5.0 5.0V Voltage Reference B1 BR2325 3 V Lithium coin Battery BH1 Coin Battery Holder HS1 6106-13 Heat Sink Screw 4-40 x 5/15 Philips Nut 4-40 x 1/4 HCS2-DX Schematic HCS2-DX Schematic HCS2-DX Schematic