The X-10 and IR Node
This node actually combines four functions in one very busy box:
I call it my node0 because it is the first and probably most important
box in my system. Each function is actually a logically seperate
software
module. In this manner, it is possible to split it away from this
physical
node, and put it into another one. All messages are sent equally to
each
module below.
The serial interface
The PIC16C74 has one hardware UART. This is assigned to the 485 port on
this box. A software UART is implemented and connected to the 232 port.
All characters are echoed from one port to the other, and then used
internally
to decode network messages.
The LCD panel
I use a 2x16 line LCD panel from EPSON. This uses the industry standard
Sharp 44780 Controller, and code examples exists in several places. It
was difficult at first getting the timing right, but the result have
been
successful. The network address of the LCD module is 'L'. The 'data'
field
of the network message will be displayed in the LCD window, allowing
any
node to display a message on the window. For example, sending the
following
message over the network:
LC_Hello[ret]
Displays "Hello" on the LCD screen, then the LCD sends an ACK back.
By the way, the address of the sender of the message above is 'C',
which
is the central controller or PC.
Useful links:
The LCD
interface FAQ
The Infra Red interface
The PIC controls a oscillator and driver that flashes an IR led via a
jack
on the box's rear panel. There is also a Sharp IR cube that demodulates
the raw IR signal to TTL level pulses. The software module has been
written
to send and receive the Sony SIRCS protocol.
The IR module's address is 'I', and it can accept commands or
requests
for sampled IR data. For example, the network command:
IC_QQ[ret]
Causes the software module to respond with the most recently sampled
IR command. The network command:
IC_[1][17][ret]
Causes the module to send a function code 17 to device code 1, and
then
return an ACK. This command turns up the volume on my TV.
Useful links:
Sony SIRCS protocol
A really big depository
of IR data
The X-10 interface
This software module is connected to an X-10 TW523 module; its address
is 'X'. For example, the following network command:
XC_QQ[ret]
May cause the software module to return:
CX_A1[ret]
Meaning that the oldest received X-10 command is A-1. The software
module
buffers up 30 X-10 commands in a fifo, sending the oldest one first.
This
way the main controller can query the X-10 interface at its
convenience,
and messages will not be lost.
Useful links:
The X-10
interface FAQ
Home Automation Main Page
Back Home