What is the SX-X10
The SX-X10 is an Embedded Ethernet device which allows you to control X10 Home Automation devices over the Internet. |
Sorry, the online demo is no longer available due to my ISP's inability to support static IP addresses.
CM17A and RS-232
- The CM17A uses RS-232 DTR and RTS signals for communication. These +12V signals also provide power for the device. The phase relation of DTR and RTS changes on these lines determine if bits 1 or 0 are being sent to the CM17A. Under normal usage, i.e. while plugged into the back of a PC, the DTR and RTS lines of the computer's RS-232 interface are manipulated by X10 software to send data to the CM17A, without interfering with most other uses of the PC's serial port.
SX-Stack and RS-232
The SX-Stack Evaluation Board has an onboard MAX232 line driver and level converter configured as a RS-232 DCE device. Although this onboard RS-232 interface is not used by the SX-Stack HTML demo, it is needed by the utility programs to load HTML data into the onboard serial EEPROM. Any hardware changes to this interface, must be reversible to allow debugging of the device, and programming of the serial EEPROM.
A Simple Interface
The SX-Stack Evaluation Board's MAX232 line driver only provides two output drivers. These drivers are connected to the DCE device's RXD and CTS for normal serial communication. However, the CM17A does not need the these signals, so we can steal the I/O ports and their drivers and use as DTR and RTS simply by creating a special pin-header to DB-9 connector.
Eval Board
Header PinDCE DB-9 Pin DCE Function DTE DB-9 Pin DTE Function 3 2 RXD 7 RTS 9 5 GND 5 GND 6 8 CTS 4 DTR This special connector allows the MAX232 to drive the RTS and DTR pins of the CM17A. The original DCE connector can be used for debugging, and for programming the serial EEPROM. It was also very handy to attach a RS-232 breakout box to the DB-9 connector while debugging the CM17A interrupt routines.X10 House Code Selection
Although the interface will accept and transmit X10 commands for any of the 256 House/Unit combinations, the GUI can only display buttons for one House Code. Initially I had hard coded the default X10 House Code selection. While making some final changes to the code, I realized that the otherwise un-utilized User Port would be an easy means of setting the device's default House Code.Although a rotary encoded hex switch can be attached to pins E0-E4 and VCC of the User Port, I've driven E0-E4's opposing pins D0-D4 high, which allows the House Code to be selected by directly jumping the pins on the User Port. The unit must be reset by pressing the reset button, before the new House Code takes effect..Push button X10 Unit control
The Evaluation Board also provides a single push switch for user control. This push button as been programmed to switch on and off Unit "1" of the default House Code. You can use that button to control an X10 device directly from the SX device. This action is similar to the buttons on regular X10 wall modules.
SX-X10 Version 1.0
Assembler
The SX-X10 implements a very basic HTTP server. This server is based on the SX-Stack Demo program, but has been re-written to allow 128 dynamic code substitutions. Every ASCII value in the HTML source above $7F is considered a special character, and forces the HTTP server to take a special action. The special character is replaced in the HTML output by a regular ASCII character <=$7F.
Here are the source HTML files which are loaded into the SX-X10 to provide the demo GUI. The odd symbols embedded in the HTML are SX-X10's special characters. These raw HTML files are processed by the SX-X10 replacing occurrences of special characters with the last known state of X10 devices.
The GIF files which create the GUI were a particular challenge. These
pieces were scanned from an actual X10 HR12A Remote Control, then pieced
together to form the interface. Because the Evaluation Board only has 32
KB of EEPROM memory, the GIF's all had to be dithered to only 16 colors to
reduce their file size. The same 16 colors were used for all the GIF's in
order to make them look like one big GIF when pieced together. As much
time as this process took, I should have created a cartoon illustration from
scratch.
This oddly named page is the default page for the web server. Its name
"/abcc.htm" hashes to the same internal lookup code as "/".
A short Demo of the SX boards Varistor/ADC based thermometer. Again, special
characters replaced, this time with converted ADC values.
SX and Ubicom
SX-List Fast Embedded Ethernet Design Challenge and Contest
Ubicom: Ethernet SX Stack Evaluation Kit
Ubicom, Inc. - Virtual Peripheral - Ethernet SX Stack Source Code