HTINews Article
- Feb98 -
[HTI Home Page]

[Click Message To Learn More]

The Complete Home Automation Controller - Testing
by Jeff Vogel


Testing:

Now that the construction is complete, we can begin testing. Remember, you only need to have completed the construction of Part 1 before anything can be tested. The other parts are optional.

Establishing communication: Testing RS-232

Using any terminal program, connect the CHAC's RS-232 port to any serial port configured to 9600 baud, 1 start bit, 8 data bits, and 1 stop bit with no parity. Then, power up the CHAC.

The CHAC will always respond upon power up with a 'System Reset' message. The user can quickly determine that RS-232 transmit and receive is operating properly by sending an 'S'. Note that the Status Command 'S' must be capitalized. Send a <CR> at any time to clear the command buffer. Sending the 'S' requests that the CHAC report the current status of it's operation. If it is not currently doing anything, a 'System Idle' response will be reported.

Checkout Inputs:

Inspect all solder joints and connections to your board. If everything looks OK, connect theCHAC to your computer. pon powerup, you should read 'System Reset' on the terminal screen followed by the status of all the digital inputs. If nothing is connected to the input section, the display should read:

System Reset
D71
D61
D51
D41
D31
D21
D11
D01.

Note: If you have any shorts to ground at the inputs, or have any input tied to ground, the status of that corresponding input will not be reported until it is either queried using the query 'D<CR>' command, or the input changes state. Now, take a grounded wire and touch each of the 8 inputs. For each time you ground an input, the CHAC will respond:

'Dn0' where n is the number of the input which is grounded. When the input senses the ground signal is no longer present, the CHAC will respond with a 'Dn1'.

Checkout Outputs:

The outputs are controlled using the following protocol:

'O{field1}{field2}<CR>'

Where {field1} is a single character detailing the specific output to be operated on and {field 2} is a single character detailing the function to be performed to the output:

Valid field 1 characters:

Valid field 2 characters:

Query Output Response:

The query output enables the user to 'double check' the CHAC's output state. The CHAC will respond with either a 1 or a 0 in the corresponding bit position for each output. When issuing the Query Output command, field 1 must be valid, but it's value is ignored. The response for this command is formulated from the output image stored in U1. If an output is currently flashing, the response will be given of the state of the output at the exact time of transmission. Therefore, the user software would have to derive a flashing condition from multiple query output commands.

Query Output Response Format (from CHAC to PC):

S{field 1}{field 2}

Note that Field 1 and Field 2 make up an 8 bit HEX value transmitted to the PC in ASCII. The intention is that the user can quickly determine the state of all outputs and perform logical operations on them once they are converted from ASCII represented HEX to actual HEX for use in a PC program.

Field 1: (bit positions 0-3) {DCBA}; where A, B, C, or D have the value of 0 or 1
Field 2: (bit positions 4-7) {HGFE}; where H, G, E, or F have the value of 0 or 1

Construction / Programming / Programming Examples / Parts List