HCS II Technical Info

Last updated: 25 November, 2008

The HCS II was first presented in the February 1992 issue of Circuit Cellar Ink. It's primary purpose is low-cost, do-it-yourself home automation, but with some imagination, it can be used to automate and monitor just about anything you like.

The HCS II is a central controller, with a number of daughter boards: Some plug into its vertical stacking bus though a pair of connectors, while others are wired through an RS-485 half-duplex network. The daughterboards expand the capability of the HCS II from supplying more digital I/O through to text-to-speech and DTMF control. It's also capable of switching on and off heavy loads through relay boards, analog sensing (such as temperatures and lighting conditions) and X-10.

Although the HCS firmware and associated programs are GNU GPL'd, it is still very much copyrighted by Circuit Cellar. Some information found here is reproduced with permission of Circuit Cellar Inc.

The information found on this page was obtained from various sources: manuals, the Circuit Cellar BBS and its successor sites, USENet and correspondence with HCS users.

Audience

This site is dedicated to documenting detailed technical info on the HCS II as a service to the community. No support is otherwise given. For general help on the HCS II, check out the Circuit Cellar website and the Circuit Cellar BBS, the HCS forum in particular.

Contents

FAQ

Where can I get help for my system?

The best place is still the Circuit Cellar BBS, and the various Articles written about it.

What does the HCS II consist of?

The HCS II consists of one of four types of Supervisory Controllers:

The third controller had some interesting bits to it. The SpectraSense 2000 and to a greater extent the RTC180 and the HCS II DX boards had a great deal of expansion capability:

RS-485-based modules

ADIO-Link
A 16 TTL input, 8 TTL output, 8 analog input and 4 analog output board. (No longer supported as of version 3.50, since it was obsoleted by HCS-AnswerMAN)
DIO-Link
An 8-bit unbuffered digital I/O board, typically used for connecting a printer to the HCS II (obsoleted by HCS-AnswerMAN)
DIO+Link
A little publicised DIO-Link board that is preconfigured for 4 buffered inputs and 4 outputs (electrically the same as BUF-IO) plus a two-channel 8-bit ADC. The ADC chip can also be changed to have 10-bit or 12-bit inputs. (obsoleted by HCS-AnswerMAN)
IR-Link
A short-lived two-way infrared controller module designed to send or receive IR signals for people tracking, etc. (obsoleted by the MCIR-Link)
LCD-Link
A module carrying an LCD display and a keypad. (alternative is the HCS-AnswerMAN)
MCIR-Link
A two-way infrared controller module that could act as a programmable universal remote controller. A number of these modules could be placed in different rooms of a building, which in addition to the tracking abilities of the IR-Link, allowed it to issue commands to consumer audio/visual equipment as well.
PL-Link
The heart of the X-10 to HCS II SC communications interface, this is the original version of an X-10 gateway to house modules.

HCS II DX and RTC/HCS180 stackable expansion

HCS-VOICE
A text-to-speech module, that when connected to a speaker, enabled the HCS II to talk.
HCS-DTMF
A telephone interface, fully capable of dealing with caller ID and has provision to interface the HCS-VOICE for talkback over the phone.
HCS-BUFIO/HCS-BUF50
direct, digital input/output ports. The HCS-BUF50 contains a higher capacity of physical I/O ports.
IDI-24
This board has 24 optoioslated inputs (requires HCS-BUF50)
IDO-24
This board has 24 relay outputs (requires HCS-BUF50)
RBUF-Term
A 16-bit digitally buffered input and 8-bit relay-buffered output board. The board uses screw-terminals to attach wiring. This is a good alternative to X-10, as it reduces the glitch-factor considerably. The board attaches to the HCS II via a ribbon cable to a dedicated header. This board could be considered a combination of the IDI-24 and IDO-24 boards.
BUF-TERM
Very similar to the RBUF-Term, this earlier board had no relays but did have a +5V power section specifically designed to be used by the RTC/HCS180.

The FCC-approved SpectraSense 2000 was targeted at dealers and installers wanting to get into the home automation market using the HCS II. More on that is located here.

Later, Circuit Cellar released some enhancements to the HCS II:

HCS-AnswerMAN
A replacement for the ADIO-Link, DIO-Link, DIO+-Link and LCD-Link modules, yielding a 4-channel 8-bit ADC, LCD control, keyboard control, 12-bit ADC/DAC, 8 bit-programmable I/O lines.
HCS-PLIX
A replacement for the PL-Link, which consists of a Micromint PLIX chip on a stackable module.
ROB4
A more robust version of the RBUF-Term board that contained just 4 high current relays. (Requires BUF-TERM)

Creative Control Concepts had the following product line in addition to the above:

PIC-TV
A compact module that did the same function as the VID-Link/ TV-Link. On the network, this appeared as just another LCD-Link.
PIC-DIO
A compact version of the DIO-Link module.
Stat-Link
A multi-purpose network module, mostly dedicated to connecting programmable thermostats.

Some users have also created their own add-ons as well.

Ron Bihler's HCS Thermostat Project
Using an AnswerMAN and a Basic Micro prototype board plus an LCD touchscreen, this project can communicate with an HVAC system. More info.
Michel Clavette's HCS UPS
A small UPS circuit to keep the HCS II up and running during power interruptions. More info plus a listing of other interesting projects he has completed.
John Morley's WeatherNode
A universal board for interfacing weather sensors to the HCS II, as well as other automation controllers. More info.
John Morley's LCD-Link
Released plans, code and photos for his version of the LCD-Link based around a PIC.
Bob Morrrison's HCS_C Combo Card
This is part of the larger HCS_C effort to create a next-generation HCS based around an FPGA design. The HCS_C Combo Card will also function with the HCS II. More info.

What are the power requirements of all these boards?

Both the HCS II DX and the original RTC180-based HCS II take approximately 150mA @ +5V.

Why are you calling it HCS II instead of just HCS or HCS-II or HCS2?

It is called the HCS II because the original HCS was presented by Steve Ciarcia in an issue of Byte Magazine dating back from the early 1980's. Also, as Ken Davidson (the principal designer and developer behind the HCS II) once said, "it's called HCS II."

Who wrote the ROM?

Ken Davidson is the ROM's original author. Jack Gansle pioneered the RTOS code for the HD64180 that was later to appear in the HCS II ROM code.

How big is the ROM?

The ROM is housed in a 27256 or equivalent EPROM, which is a 32KB device.

What compiler is used for building the HCS II ROM?

The HD64180 cross-assembler from 2500ad was used. The company has since been bought by Avocet, and lives on in the ADX product line. There's a 20% hobbiest discount for the cross-assembler. Sticking to this cross-assembler, while expensive, saves on having to port the code to other cross-assemblers and keeps and CVS repository pure.

What other cross-assemblers can I use?

If the Avocet assembler isn't desired, there are a couple of other possibilities:

What is the correlation between the hardware names and the naming in the XPRESS language for the HCS II SC variants?

In XPRESS 2.0, the CONFIG SC = arguments are listed as follows:

HardwareSoftware Arg
RTC180 onlySC1
RTC180, RTC-BUFIO or RTC-BUF50SC2
BCC180, BCC13SC3
BCC180, BCC13, BCC54SC4
BCC180, BCC30, BCC54SC5

In XPRESS 3.0 and up, the CONFIG SC = arguments are listed as follows:

HardwareSoftware Arg
BCC180IND180
RTC180HCS180
SpectraSense 2000SpectraSense

Help! Why does my PL-Link hang? Or, why is the TW523 module's LED blinking fast? Or, why is the LED on the PL-Link not on?

The PL-Link, which is the X-10 gateway for the HCS II system, can sometimes hang due to a power supply glitch, or more commonly, because of a loss of electricity - sometimes a rapid on-off, other times a prolonged duration. This can be visually observed by looking at the TW-523 module and noting the rapidly flashing red LED. This isn't the normal behaviour.

From a technical viewpoint, what is happening is the PL-Link is freezing in transmit mode because the reset circuitry hasn't generated a true reset on the board.

There are three solutions to this, one temporary, one permanent and one avoiding the whole thing altogether:

I have an HCS-PLIX, or I want to build one, but can't source the parts?

NTE makes the Motorola 6821 PIA used in the HCS-PLIX. It's available through their distributors. The PLIX chip is still available from Micromint.

Are there any watchdog circuits in the HCS II SC?

There are no watchdog circuits built-in to the HCS II SCs. However, in an article printed in the January 1995 issue of Circuit Cellar Ink, Steve Ciarcia described a couple of watchdog circuits that can be added around the HCS II.

What about Y2K problems?

Y2K wasn't that huge of a problem with the HCS II for the most part, since XPRESS dealt with 2-digit years. However, Mike Baptiste made some useful observations:

Early HCS-II boards (and probably RTC180s with older SmartSockets) used DS1215/DS1216 chips. This chip handles 2000 OK but it will NOT treat 2000 as a leap year. The cheap fix - reset your clock on March 1st (not sure if it will let you set it to 2/29/00 - haven't tried) Or, you can replace your DS1215 with a DS1315 that handles the 2000 leap year. If you have an RTC180, you'll have to replace your smart socket (not cheap) if it has an older DS121X chip in it. If you want a DS1315, let me know - I have plenty. $9.95 (shipping included) Before you think I'm gouging, check your electronic catalogs. These chips are not cheap.

XPRESS deals in 2 digit years and is OK though the published Y2K baseline is v3.6 Note you need to ensure your XPRESS code doesn't have a Y2K bug in it like IF YEAR > LASTYEAR THEN

HOST had a problem with setting the time in 2000. A new version available on the website (v3.62) will solve this problem and can be used with XPRESS v3.x Not sure about v2.x - haven't tried that yet.

The best test you can do is set your HCS clock to Dec 31, 00 and let it roll over. Try fooling around with XPRESS time/date commands with the date set to 2000 and see what happens. Most users who have tried this have reported no issues though I don't know which versions they were on. The XPRESS firmware change history shows no mention of any Y2K specific fixes though that doesn't mean there were any.

What protocol does the HCS II use to communicate with its modules?

The HCS II uses RS-485 for the network signalling to connect over a twisted pair with the other modules. The HCS II then uses ASCII packets for the inter-module protocol communications.

Is there a right or wrong way to building an RS-485 network?

A typical RS-485 network is built in a daisy chain manner. However, over the years many HCS users have opted to build their networks in a star configuration. The risk in doing this is that reflections on the network can turn up if terminations aren't properly done, since there's meant to be a termination at each end of a cable run.

Speaking of termination, there should only be two terminations activated on the network at once and preferably on the end of the longest cable runs. Also, somewhere along the network, pull-up and pull-down resisters (found on all the COMM-Links) should also be activated, again typically where the terminators are located. This keeps the HCS RS-485 network in a stable state.

If you intend on using a star configuration, or a hybrid of star and daisy chain, then experimentation on the placement of the terminators is required. Also, the location of the pull-up and pull-down resisters in the network can differ accordin to most people's experience. Again, experiment with these and don't be surprised if the network behaves better despite them not being active where the termination resisters are.

Do the Micromint RTC180 boards work as a replacement for the HCS II?

According to pictures of the early versions of the HCS II, it appears that the RTC180 was in fact used as the original HCS II supervisory controller. There are some key differences between the RTC180 and the HCS II DX that came out later (as part of a Circuit Cellar Ink magazine promotion) however:

As far as backing up memory is concerned, the best way to do this is through the use of a Dallas Semiconductor SmartSocket, which features on-board batteries in a 28-pin DIP. Also, if you wanted to back up the log memory, using this socket for that makes sense as well.

What's this about a timing drift on the HCS II?

Originally, the HCS II was created with an HD64180 chip running at around 9MHz. Mike Baptiste then found a way to double the speed using the existing crystal by swapping in a Z80S180. However, the onboard clock tended to tick faster than normal. The solution was to swap out most all the LS logic for the 74F family logic.

What about the Micromint BCC180?

As a matter of fact the BCC180 is known to function with the HCS ROM as well. Steve Ciarcia himself ran the HCS II ROM using a BCC180, plus a bunch of expansion boards for controlling hardwired links. (Steve's preferred method of running his house is using hardwiring, as opposed to using X-10.)

What is a COMM-Link?

A COMM-Link (or Comm-Link) is a common processing, RS-485-networkable platform that can be adapted for any HCS II purpose. A good analogy is a common automobile chassis upon which different models can be built. There have been two types of COMM-Link:

It should be noted that the 8031-based COMM-Links came in two generations: The first generation boards were simply called COMM-Link on the silkscreen and are easily identifiable by the prototyping area of the board, and the different layout of the LEDs; The second and more common generation is the one lacking a prototyping area and has COMM-Link2 written on the silkscreen.

While the PIC is newer and more compact, there's absolutely nothing wrong with using the original COMM-Link designs. The point is that anything can be called a COMM-Link, so long as the HCS II ROM knows how to deal with it. Also, the single biggest advantage to the original design was it's cookie-cutter approach: Improvements to one COMM-Link board could very well be ported to the others.

Examples of 8031-based COMM-Links have been:

Some examples of PIC-based COMM-Links:

By far one of the biggest advantages of using the original COMM-Link design is their flexibility to be redeployed as another type of -Link. For example, some users have converted extra PL-Links to MCIR-Links with the swapping of a few parts and the EPROM.

Which Network modules are supported directly by the ROM?

Today only six are defined as directly supported:

Plus two reserved bytes for future expansion.

What about the Micromint BCC series boards?

As described elsewhere, the Micromint BCC series boards can work with the HCS II ROM. Boards supported are the BCC54, BCC30 and the BCC180.

Is the COMM-Link source code really in the Public Domain?

This is a misconception based on the original filename of the zip'd source code. The 'public' in the filename denotes the fact that the source code was cleaned-up of documents like internal memos and such, and commented. Thus the word 'public' really means, "for public consumption".

In what languages is the source code for all of this written in?

The HCS II and its modules are written in the following:

The user-contributed or original designs also varied:

Why were PICs used for the second generation COMM-Links?

Mike Baptiste created these modules around the PIC because that's what he was familiar with. He later on sold these under the Creative COntrol Concepts name.

What has been the bone of contention for the HCS II? What do I do about my log memory

By far the single biggest complaint is related to memory - or a lack of it. Despite the Z80180 processor being able to access 1MB of RAM, it can only do so using bank-switching techniques. Unfortunately, there are no free memory windows due to the fact that the 64K memory segment being split in two: 1 half for the events program and the remainder for log memory.

The other issue, which is pressing from an aesthetics and accessibility viewpoint, is that the stacking bus of the HCS II doesn't lend itself to a standard enclosure or panel. As a result, the panel could get very expensive if you're looking for a 4-5 inch or greater depth.

One solution proposed (but never pursued) was to build a COMM-Link that would accept logging from the HCS II via the RS-485 network. The biggest advantage of this was that the HCS II could be brought down without losing logging data, and the "Log-Link" could be whatever design was chosen.

Other ideas include:

(If you believe the last point is a kludge, realize that many customers of industrial building automation systems have run into the same thing and in response, a number of vendors elected to sell Windows-based servers that monitor existing installations through a serial-to-ethernet add-on. Thus the limitation of logging memory was dealt with by selling automatic log data downloading as a feature. If you think about it, this means having the ability to run a number of separate yet identical systems and letting the server polling them determine which was what controller and identifying log entires in that manner.)

Who or what is Creative Control Concepts?

Creative Control Concepts was a company founded by Mike Baptiste, an enthusiastic and long-time user of the HCS II, which took a license of the HCS product line from Steve Ciarcia and Circuit Cellar. However, within two years, sales dwindled and the company shut down operations. Until December of 2006, it wasn't selling or supporting any HCS II products since mid 2001. As of January of 2007, Creative Control Concepts restarted operations to sell add-ons for the HCS II (but no Circuit Cellar HCS II hardware as it is no longer licensed for that). In any case, the website remains running with HCS II info as a service to the community.

My hardware is dying, what do I do?

As implied above, the Micromint boards are still the primary (and remaining) source. The COMM-Links upon which many of the remotely-connected RS-485 modules are based on can be built from scratch again around the venerable but reliable 8031. However, to save that work, just order an RTC31 from Micromint and an RTC-proto board to layout the work. Or, for the minimalist, just get a board with extended connectors and just the necessary logic for the 8031 to drive.

For replacing the Supervisor Controller, the option is to find another one from a user willing to part with theirs, or buy the RTC180 or the BCC180. Note that the RTC180 has a number of disadvantages to it, compared to the HCS II DX board, as described above.

Otherwise, consider looking into other HA systems.

What is the compile program? What is Host?

The HCS II uses two DOS-based programs:

Does Host and compile run under Windows?

Host is known to run under windows 95/98/98se/ME but not under Windows 2000 or XP. This is because the older versions of Windows allow DOS-based programs to write directly to the serial port hardware, while the latter versions of Windows force applications to go through virtual drivers. There have been sporadic reports that Host can run under Widnows XP.

compile can run under any version of DOS or Windows.

Can any of this work under Linux?

Linux, using the DOS emulator dosemu, can run both these programs without any problem. However, compile can compile cleanly under GCC without modification, so compile can be run natively.

How soon will an uploaded events.bin take effect.

The effect is immediate while the RS-485-linked modules might lag a second or two, depending on the EVENTS program you wrote.

What versions of Host and compile do I have to use with my HCS II?

You should always use the version of Host and compile that matches your ROM version. Although there's no way (yet) to determine the ROM version from remote, the HCS II is smart enough to know the difference, and will reject a mis-match on a program upload attempt.

What versions of ROM software is available for all the hardware?

The best place to view all versions of software is here

What is WinHCS?

WinHCS was written by Philippe C. Printz and is a Windows GUI front-end replacement for Host. It can act as a wrapper for the DOS-based compile to build and then upload a new events.bin file. It currently supports up to version 3.63 of the HCS II ROM. The intended operating system appears to be limited to Windows 95 and 98. Windows XP virtualizes hardware, and requires that software needing to access hardware like serial ports go through an API instead. There have been unconfirmed reports that WinHCS does work under Windows XP otherwise, but really the only way it to try it and find out.

When trying to reconfigure the AnswerMAN via its serial port, I get syntax errors and scrolling text or scrolling prompts. What's wrong? Also my keypresses are being ignored.

There are two things wrong:

  1. Make sure flow-control is set to none in your comm package; and
  2. Remove the RS-485 chip. It shares the serial lines with the MAX232. Once you're done with AnswerMAN programming, then put the RS-485 chip back.

Of course you did jumper the AnswerMAN's CFG pin to tell it to enter config mode....

What is XPRESS?

XPRESS is a production rule style language. In other words, it uses what's called event equations. So, if an event (an input of any sort, like heat, temperature, door, water, etc. sensors) get triggered, then an action (siren, log note, printer note, LCD display update, etc.) is taken. It is this language that allows the HCS II user to determine how their home is run.

Got any sample HCS XPRESS programs?

Have a look at the samples directory for a few good examples of a some real-world programs.

How big of an XPRESS program can I have on the HCS II SC?

According to Ken Davidson:

Maximum program size is about 18K based on the size of EVENTS.BIN. Compared to the number of systems we have out there (thousands), very few people have bumped into that size limit. The best way to keep your program from becoming too big is to limit the amount of text you use with LCD displays and the voice board. Normal XPRESS statements take up very little space. Raw ASCII text can't be compressed, though, so takes up a lot of space. The two statements you cite compile to exactly the same code. The Define statement is a compiler feature that makes your life easier. It doesn't result is any extra code generation. Also, the number of statements per line makes no difference. A carriage return character is treated the same as a space or a semicolon. You could put your entire program on a single line and the compiler wouldn't care (well, with some exceptions; code size still isn't affected, though).

The Edge state really isn't needed when you use If statements. An "If Input=On" is the same as "IfA Input=ON and Input=Edge" since they both allow the Then portion to be executed just once upon a transition of the input from Off to On. Of course, if what you're looking for is any transition of the input (either Off to On or On to Off), then the Edge state saves a bit of room.

How much log memory is available?

The HCS II has 32K of log memory available, which is not battery backed. This can easily be fixed by using a Dallas Semiconductor SmartSocket.

Are there version compatibility issues amongst different ROM versions?

Version 3.0 and up of the HCS II ROM has a different set of commands for selecting which SC to use. In the case of the 2.x ROM and below, these versions were explicit in choosing configurations based around the BCC180 and certain combinations of BCC bus boards. As of 3.0, the ROM probes the hardware to figure out what hardware is actually present in a BCC180-based HCS II.

Additionally, version 3.0 and up uses the control lines of the serial port, whereas previous versions did not. Make sure that the cable used to connect the HCS II has all the conductors connected just in case.

Did Circuit Cellar ever produce an RS-485 repeater?

They did indeed. However the code hasn't ever been found.

How can I connect the HCS II to the Internet? Ethernet? LAN?

Really these are all asking the same question: How to Ethernet-enable the HCS II? As yet, no solution from either Micromint or Circuit Cellar has been released and it's not known whether they will. On the other hand, Mike Baptiste back in November of 2000 made an announcement that he had a working (but non-secure) prototype based around the TINI board.

Other users have uesd various serial to ethernet solutions over the years to varying degrees of success.

A number of commercial products have been released over the years that allows a serial port to pass-through a device that converts the serial communications into an ethernet-ready appliance. Such devices will usually take the serial data and permit transmission and reception via a user-selectable TCP or UDP socket.

My BCC180-based HCS II sometimes won't respond to Host!

A BCC180 can appear to hang if the Host doesn't get responses to your commands (new program load, set time, etc.). This can happen if a network module times-out because it is down or unavailable. When the module does time-out, an 'E' appears in the Network modules window, but has the side affect of not only shutting down the RS-485 network, but also the console port! So far, this bug appears in v3.00 and up.

I have a 3.x or older ROM version of the HCS using an RTC180. Can this be upgraded?

Yes, it can. The upgrade as presented by Mike Baptiste at his website will work, simply by swapping out the RAM chips for faster memories and swapping the 74LS245s for 74HCT245s. (Of course you need to swap out the HD64180/Z80180/Z180 for the Z80S180 CPU.)

Then, you just need a version 4.x or newer HCS ROM, XPRESS compiler and host interface.

Does any of this work in 50Hz electrical systems?

The HCS II can operate with electricity running at 50Hz. The only thing to watch out for is the PL-Link. A different ROM needs to be used for PL-Links running at 50Hz. There's a specially baked ROM image for such systems located in the files area at the top of this page.

Can the SpectraSense 2000 be upgraded to a Z80S180 CPU?

Although the SpectraSense 2000 is essentially the same hardware as the HCS II components put together, this hasn't ever been tested. In theory, it should work.

Does the RBUF-Term schematic contain an error related to the power LED?

On page 20 of the RBUF-Term manual, the schematic is missing the power LED. The power LED is tied to pin 10 of the resister network SIP and ground.

Where can I get part X for my boards?

Bestar is a defunct electronic components company that supplied the relays found in the RBUF-TERM. NTE now makes these under part number R73-5D10-12. (NTE also makes a number of osbolete parts in case you were wondering.)

Otherwise, many of the parts in the COMM-Link boards as well as the HCS II are still readily available.