 POWER LINE INTERFACE(s)
 ====================

 These units allow you to interface with the AC power line through an
 optically isolated device. You, as the application programmer, can
 create your own sensor, controller, whatever you wish.

 The host processor could be a dedicated micro-controller or a PC. This
 product was designed as an O.E.M. product to be interfaced to a
 burglar alarm system, or whatever the application required. Because it
 is optically isolated from the AC line and is CSA approved,
 developement costs are greatly reduced.

 PL513
 =====

 This unit, about the size of a lamp module allows you to TRANSMIT
 X-10 signals over the AC power line.

 TW523
 =====

 Same as the above but can both RECEIVE AND TRANSMIT.

[NOTE: the following are available from

         Baran-Harper Group
         77 Drakefield Road
         Markham, Ontario L3P 1G9
         Orders or info (416) 294-6473
         BBS (416) 471-6776


 1: A TSR (terminate and stay ready) software package for the IBM PC.
    The package consists of a PL513, cable and DB25 connector,
    documentation and the TSR software. The cable/doc/software sells
    for  $50.00. The PL513 is extra. It requires a IBM PC and is
    connected via the Parallel port. Additional Parallel cards are also
    supplied.

 2: A second package designed for either the TW523 or the PL513 unit.
    This consists of the connector, software, and documentation.
    The software is written in C, the source is supplied so that you
    can integrate the read/write routines into your custom program.
    The price for this package, less the TW523/PL513 is $ 35.00]


Below is listed the technical notes associated with the above two units

CONTENTS

Introduction
Description
Block Diagram and Pin Connections

Circuit Description
Schematic Diagram
Electrical Characteristics

User Circuit Example
Transmission Theory
Timing Diagrams

Transmit Timing Diagrams
Receive Timing Diagrams
X-10 Compatible Products

INTRODUCTION

The X-10 POWERHOUSE code format is the 'De Facto' standard for Power
Line Carrier (P.L.C) transmission. The code format was first introduced
in 1978 with the Sears Home Control System and shortly after with the
Radio Shack Plug 'n Power System. Since then, X-10 has developed and
manufactured O.E.M versions of its Home Control System for Stanley,
Heath/Zenith, Leviton, General Electric, C & K Systems, Schlage Lock
etc, etc. We have also introduced versions of the system in Canada,
Germany, Holland, France, Switzerland, Japan, Australia.

All of these systems use the X-10 code format, all are compatible. It
is therefore advantageous for any Home Control System to be
compatible with the X-10 standard.

GATEWAY TO X-10

In order to encourage others to take advantage of the large installed
base of X-10 devices and to develop your own devices the TW523 was
developed as a cost effectiveinterface to the 110 volt AC system. All
connections to the power line are made by the TW523 and all connections
between the TW523 and your O.E.M. equipment are opto-coupled. This
relieves the O.E.M. of any U.L. or C.S.A. considerations.

TW523 TWO-WAY POWER LINE INTERFACE DESCRIPTION.

The TW523 plugs into a regular AC outlet and connects to the O.E.M.
product via a modular RJ11 telephone jack. It provides an opto-coupled
60 Hz. trigger signal to the O.E.M. product. This signal is used to
synchronize X-10 transmissions to the zero crossing point of the AC line
The O.E.M. generates the X-10  code 'envelope' with respect to this
reference and applies it to the opto-coupled input of the Tw523 which
modulates the envelope with 120KHz and applies it to the power line.

The TW523 also has an opto-coupled output which provides an isolated
demodulated x-10 code envelope which represents x-10 codes received

CODE TRANSMISSION

To transmit x-10 signals the user must supply 1ms 'envelopes' to pin 4
(TX) on the TW523. These envelopes must be correctly timed relative to
the zero crossing point of the ac line. The correct format for x-10
code transmission  is described in later pages.

CODE RECEPTION

- Custom proprietary I.C. to read x-10 codes from the power line
- Microprocessor does not have to monitor the ac line for signals
- When a valid x-10 code is received, it is stored in the custom I.C.
  and retransmitted (in envelope form) to the OEM product. This
  transmission is coincident with the second x-10 transmission. x-10
  codes are always transmitted twice.
- Data sent to oem is valid
- Start code (1110) can be used to alert the oem product `that an x-10 code
will follow. a '1' bit from the TW523 appears as a negative going pulse 1.1  ms
long, beginning approx. 100us after zero crossing. The user should sample his
data between 500 and 700 us after zero crossing. The LED is illuminated when AC
power is applied to the TW523, and blinks off whenever a valid x-10 code is
received.

The TW523 can read x-10codes from its own input. This feature allows
the oem to build in a data collision detection.

The line monitor capability of the TW523 allows the oem to ensure that
the power line is free from x-10 signals before starting a
transmission. For example, if after detecting that the line is free, a
transmitter waits for a random number of power line half cycles before
transmitting, the chances of collision is reduced. a different priority
can be assigned to each transmitter by including a fixed delay before
the random delay. The shorter the fixed delay, the higher the priority.

BLOCK DIAGRAM AND PIN CONNECTIONS.

The interface outputs a 60-Hz square wave to the OEM equipment to
provide a reference for code generation. The x-10 signal envelope is
generated(within the oem equipment) with reference to this square wave.
The signal envelope modulates a 120 khz, carrier and the resultant
X-10 code is capacitively coupled onto the AC power line in synchroni-
zation with the zero crossing point.  A signal "envelope" representing
received valid X-10 codes is available to the OEM.  The X-10 code for-
mat is patented, but as X-10 transmission and reception is performed
within the TW523 all patent related criteria are satisfied by the
TW523.  Permission to transmit or receive the X-10 code format is
granted only in conjunction with the use of X-10 Powerhouse Power
Line Interfaces.

Connection between the OEM equipment is via a standard modular phone
jack, the connections for which are as follows:


1.     B         Zero crossing detect output
2.     R         Common.
3.     G         X-10 receive signal envelope output.
4.     Y         X-10 transmit signal envelope input.



Circuit Description.

Power  Supply.

0V in this product is directly connected to one side of the AC line
Therefore, for safety, an ISOLATING power transformer MUST be used
when attempting any internal measurements.

The power supply for the interface is capacitively derived from, and
is directly referenced to, the 120V AC power line.  Care should be
taken when monitoring any internal circuitry with an oscilloscope,
as the OV reference in the interface is NOT isolated form120 volts.
The supply provides a +30 V supply for the output drive circuit and
L.E.D.

Opto-Coupled Zero Crossing Detection.

Transmissions are to be synchronized to the zero crossing point of the
AC power line and should be as close to true crossing as possible but
certainly within 200 microseconds.

The Interface is designed to be interfaced to other microprocessor
circuitry which provides output compa~.[ܢ)Lc2ɵ5Rand therefore synchronized to the zero crossing point of the AC power
line.  It is therefore necessary to provide a zero crossing reference
to the OEM microprocessor.It is likely that this microprocessor will
have it's own "isolated" power supply.  It is necessary to maintain
this isolation and therefore a trigger circuit such as that normally
used in X-10 Powerhouse controllers not desirable as this would
reference the OEM power supply to the AC power line.  It is also not
desirable to take the trigger from the secondary side of the power
supple transformer as some phase shift is likely to occur.  It is
therefore necessary to provide and opt-coupled trigger.

Opto-Coupled Signal Input.

The input signal required from the OEM equipment is the signal
"envelope" of the X-10 code format, i.e. high for 1 ,ms.coincident
with zero crossing represents a binary "1" and gates the 120 Khz
oscillator through to the output drive circuit thus transmitting
120 Khz. onto the power line for 1 ms.

Low for 1 ms. coincident with the zero crossing point represents
a binary "0" and turns the 120 Khz. oscillator/output circuit off
for the duration of the 1 ms. input. See transmit timing diagrams
on page 13.

This signal envelope is also applied to an LED driver circuit to
indicate power-on and transmission status.  The LED is normally on
to indicate the presence of power, and "blinks" OFF to indicate that
a signal has been transmitted or received.

Oscillator.

The input to the output drive circuit is provided from a free running
120 Khz. oscillator. The frequency of this oscillator is critical
for reliable operation of S-10 Powerhouse receiver modules and is
factory set to within 2%.

Output Drive Circuitry.

The 120 Khz. X-10 code is coupled to the power line by an isolating
tuned circuit.  The input to this circuit is provided from the 120V
AC power line is accomplished within the Interface and therefore the
OEM need not be concerned with any safety and regulatory restrictions.


Opto-Coupled "X-10 Received" Output.

X-10 codes present on the AC power line are coupled to a custom
Integrated Circuit in the TW523.  This I.C. checks incoming 120 Khz.
for X-10 compatibility and provides a 1 ms envelope the OEM. This
envelope is coincident with the second X-10 transmission (X-10 codes
are always transmitted in groups of two).  A "1" bit is represented
by a 1 ms burst of 120 Khz. on the power line coincident with zero
crossing points in a three-phase distribution system.  The "X-10
received" output from the TW523 looks like a string of negative
going 1 ms "envelope" pulses occurring just after zero crossing.
Although X-10 transmitters send three 1 ms bursts per half cycle to
represent a "1" bit, the TW523 will output only a single negative
1 ms envelope corresponding to the zero crossing of the phase the
TW523 is connected to.


Electrical Characteristics.

Absolute maximum Ratings.

AC input                                        130VAC
Continuous voltage at RJ11 connector pins (wrt common) +-20V
Storage temperature range                       -40 to +70 deg. C
Operating temperature range                     -10 to +50 deg. C

Electrical characteristics at 25 deg. C

DC characteristics:  Voltages and currents measured wrt common.

1. Transmitter input

Min. Logic "1"             4V (input will sink approx. 2.5mA)
Max. Logic "1"             20V (input will sink approx. 18mA)
Max. Logic "0"             0.8V

A Logic "1" at the transmitter input will send a burst of 120 Khz
data onto the power line for as long as the transmitter input remains
high.

2.  Zero crossing output and receive output.  These outputs are
active low and open collector high.

Current sink capability         Min. 1.6 mA at < 0.5V
Leakage current                  < 10uA at 10V


AC Characteristics:

Characteristics controlled by TW523

Transmitter output power           60 mW average (5V pk-pk into 5ohms)
X-10 output carrier frequency      120 KHz +- 2KHz
Zero crossing detect tolerance     +- 100 us max.  (this is the max-
                                   imum difference between zero cross-
                                   ing of the power line).

Isolation Voltage                  2500V r.m.s. 60 Hz for 1 min.

Characteristics controlled by the OEM


                                       Min.      Max.

Width of X-10 code envelope pulses     950uS     1100uS

Max. delay from zero crossing output             50uS
to start of transmit envelope

Transmission Theory.

X-10 transmissions are synchronized to the zero crossing point of
the AC power line.  The design goal should be to transmit as close
to the zero crossing point as possible but certainly within 200
microseconds of the zero crossing point. The Interface provides a
60 Hz. square wave with a max. delay of 100 usec from the zero cross-
ing point of the AC power line.  The maximum delay between signal
envelope input and 120 us of the square wave.

A Binary 1 is represented by a millisecond burst of 120 Khz. at
the zero crossing point and a Binery 0 by the absence of 120 Khz.
The Interaface modulates it's input with 120 Khz., therefore only the
1ms "envelope" need be applied to it's input.  These 1 millisecond
bursts should actually be transmitted three times to coincide with
the zero crossing points of all three phases in a three phase dis-
tribution system.

A complete code transmission encompasses eleven cycles of the
power line.  The first two cycles represent a Start Code. The next
four cycles represent the Housecode and the last five cycles repre-
sent either a Number Code or a Function Code (On, Off, All lights
on, All units off, Bright or Dim). This complete block, (Start Code,
House Code, Key Code) should always transmitted at least twice except
for bright and dim which may be transmitted only once.

Power Line Cycles
Code transmitted when a number button is pressed.
Code transmitted when a function button is pressed.

Within each block of data, each four or five bit code should be trans-
mitted in true and inverse form on alternate half cycles of the power
line. I.E. if a 1 millisecond burst of signal is transmitted on one
half cycle, (binary 1) then no signal should be transmitted on the
next half cycle, (binary 0).

The Tables in figure 6. show the Binary codes to be transmitted for each
housecode and keycode. The Start Code is Always 1110 which is a unique
code and is the only code which does not follow the true-complement
relationship on alternate half cycles.

     Figure 6.   House Code and Key Code Tables.


              House Codes                             Key Codes

         H1  H2  H4  H8                        D1  D2  D4  D8  D16

     A   0   1   1   0                  1      0   1   1   0   0
     B   1   1   1   0                  2      1   1   1   0   0
     C   0   0   1   0                  3      0   0   1   0   0
     D   1   0   1   0                  4      1   0   1   0   0
     E   0   0   0   1                  5      0   0   0   1   0
     F   1   0   0   1                  6      1   0   0   1   0
     G   0   1   0   1                  7      0   1   0   1   0
     H   1   1   0   1                  8      1   1   0   1   0
     I   0   1   1   1                  9      0   1   1   1   0
     J   1   1   1   1                 10      1   1   1   1   0
     K   0   0   1   1                 11      0   0   1   1   0
     L   1   0   1   1                 12      1   0   1   1   0
     M   0   0   0   0                 13      0   0   0   0   0
     N   1   0   0   0                 14      1   0   0   0   0
     O   0   1   0   0                 15      0   1   0   0   0
     P   1   1   0   0                 16      1   1   0   0   0
                            All Units Off      0   0   0   0   1
                             All Units On      0   0   0   1   1
                                       On      0   0   1   0   1
                                      Off      0   0   1   1   1
                                      Dim      0   1   0   0   1
                                   Bright      0   1   0   1   1
                           All Lights Off      0   1   1   0   1
                            Extended Code      0   1   1   1   1
                             Hail Request      1   0   0   0   1   *
                         Hail Acknowledge      1   0   0   1   1
                              Pre-set Dim      1   0   1   X   1   **
                    Extended data (analog)     1   1   0   0   1   ***
                              Status = On      1   1   0   1   1
                             Status = Off      1   1   1   0   1
                           Status request      1   1   1   1   1   ****

     *Hail Request is transmitted to see if there are any other X-10
     transmitters within listening range.

     **In a Pre-set Dim instruction, the D8 bit represents the M.S.B. of
     the level and the 4 Housecode bits represent the 4 Least Significant
     Bits.

     ***The Extended Data code is followed by 8 bit bytes which can represent
     Analog Data (after A to D conversion). There should be no gaps between
     the Extended Data Code and the actual data, and no gaps between data
     bytes. The first 8 bit byte can be used to say how many bytes of data
     will follow.

     ****The X-10 Powerhouse R.F> to X-10 gateway (model number RR501) is
     a Two-Way Module. If the RR501 is first addressed by transmitting it's
     Housecode and Unit Code, and then the code "Start code Housecode -
     Status request" is transmitted: the RR501 will respond by transmitting
     "Start Code Housecode - Status" where "Status will be 11011 if the RR501
     in On and 11101 if the RR501 is Off.

Note: X-10 Powerhouse receiver modules require a "silence of at least
3 cycles of the power line between complete code transmissions.  The one
exception to this rule is the bright and dim codes which are transmitted
continuously with no gaps between transmissions.

Timing Diagrams. Transmissions.

A square wave representing zero crossing detect is provided and is
within 100us of the zero crossing point of the AC power line.  The out-
put signal envelope should within 50 us of this zero crossing detect.
The signal envelope should be 1 ms - 50us + 100us.

Reception

The "X-10 received" output from the TW523 coincides with the second
half of each X-10 transmission. This output if the envelope of the
burst of 120 KHz received.  Only the envelope corresponding to the
first burst of each group of 3 bursts is available at the output of the
TW523.


---

[More information on the Baran-Harper Group's TW523-to-PC interace.]

The TW523 has four connections on an RJ11 connector:

    Signal                      Pin #
    -------------               -----
    Zero Crossing                 1
    Signal Ground                 2
    Transmit Input                4
    Receive Output                3

Neither the parallel or serial are used as they were designed to work, and the
signals, for the most part, are sent on status lines.

Parallel:

   Receive        uses the auto linefeed line (DB25 pin 14)
   Transmit       uses alternating data lines 1,3, & 5 or 2,4, & 6
                  tied together.
   Zero Crossing  uses printer read output (DB25 pin 17)

Serial:

   Receive        uses CTS line  (DB25 pin 5)
   Transmit       uses RTS line  (DB25 pin 4)
   Zero Crossing  uses DSR line  (DB25 pin 6)

Signal ground, in each case, goes to the signal ground.  Either interface
requires some electronics to condition signals so they can be received, and/or
not damage ports.

If you have the TW523 and just need the interface, you can get one, serial or
parallel, without buying the whole kit, about $35, from:

         Baran-Harper Group
         77 Drakefield Road
         Markham, Ontario L3P 1G9
         Orders or info (416) 294-6473
         BBS (416) 471-6776


