Tuesday, January 24, 2012

HCS II & DollHouse

As I said the other day, my thoughts on home automation have brought me back to the 1988 HCS II. At a high level view, the HCS II is a relatively simple system to understand. At the center is the z180 based Supervisory controller (SC). It has a RTOS and user language called XPRESS. XPRESS is basically a loop that supports if/then/else logic. There's support for 16 bit, signed, integer math and access to the devices. The SC's directly connected hardware supports analog input, digital I/O, a realtime clock, a system bus for expansion, RS485 for remote I/O (Comm-Links) & a RS232 user interface. The I/O attached directly to the SC is the fast I/O and the I/O attached to the remote Comm-links is a little slower but more flexible. Of course I want to update the system to take advantage of modern technology, like access to information on the internet and to have a nice web based GUI.

The first part of my project entails writing an Arduino based comm-link. This should make it pretty easy for various folks (hardware and software types) to get started. . I can then plug in my Linux box (with a USB RS485 dongle) to the existing HCS II system and the Linux Comm-Link software can emulate any of the comm-links. I can extend that to also be a sniffer without too much trouble (always a useful tool in diagnostics). Using high level languages makes getting the logic down pat before the harder, tighter code for the actual comm-links. I'll write the code in such a way that it should be mostly portable to the comm-link microcontroller. Worse comes to worse, it's portable at a psuedo code level.

Next I have a few new PIC32 chips waiting for something to do so I might as well take advantage of them. The 28 pin DIP version is pretty hacker friendly and would make for a very powerful comm-link. A bread board, the Chipkit Arduino-like setup, some simple IO and you're on your way. I've got a couple of the MX220 family (32K Flash,8K of RAM, they have support for USB also). I may attempt to get FreeRTOS running on the PIC32. Might be overkill for use with a comm-link but I'd like to learn about using a RTOS. The RTOS would replace the Arduino-like environment so that will be for more advanced users.

Yes, these technologies are not necessary but I want to learn about new things, which really is the point of me doing this. Then jumping ahead I'd like to get FreeRTOS & LWIP running on a top end PIC32 (has Ethernet too). This could be a replacement for the HCS II's SC. Then I'll attempt to get an SC emulator running under Linux. The top end PIC32 has the advantage of having support for a RTOS (FreeRTOS) but limited memory. An embedded system running Linux has a few advantages of its own such has access to tons of applications, libraries and languages. I haven't tried working with RT Linux so I don't know its capabilities. My end goal is to have the embedded Linux as the main SC, while the PIC32 based SCs act as remote SC to manage a network of comm-links. The disadvantage of Linux is the immediate loss of the direct/fast I/O. I could add a PCI board to handle that but that's a bit expensive (in one shot). I'd rather add IP nodes or, less prefereably USB modules for direct I/O. The IP & USB will suffer some form of latency whereas a PCI board shouldn't.

Well, many roads to venture down, only time limiting our travels.


Post a Comment

<< Home