Shop OBEX P1 Docs P2 Docs Learn Events
X-10 Module program — Parallax Forums

X-10 Module program

ArchiverArchiver Posts: 46,084
edited 2003-03-24 23:57 in General Discussion
Anyone know if there are any sample programs for the X-10 Module controller on
the parallax web site at:

http://www.parallax.com/detail.asp?product_id=27940

?

thanks,

Leroy Hall

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-03-23 18:19
    Anyone know if there are any sample programs for the X-10 Module controller on
    the parallax web site at:

    http://www.parallax.com/detail.asp?product_id=27940

    ?

    I am specifically looking for use with a lamp dimming module.


    thanks,

    Leroy Hall
  • ArchiverArchiver Posts: 46,084
    edited 2003-03-23 19:08
    --- Leroy Hall <leroy@f...> wrote:
    > Anyone know if there are any sample programs for the
    > X-10 Module controller on
    > the parallax web site at:
    >
    > http://www.parallax.com/detail.asp?product_id=27940
    >
    > ?
    >
    > I am specifically looking for use with a lamp
    > dimming module.
    >
    >
    > thanks,
    >
    > Leroy Hall
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed.
    > Text in the Subject and Body of the message will be
    > ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    > {$STAMP BS2}

    ' Program: X10_DEMO.BS2 (Demonstration of X-10 control
    using Xout)
    ' This program--really two program
    fragments--demonstrates the
    ' syntax and use of the new XOUT command. Basically,
    the command
    ' works like pressing the buttons on an X-10 control
    box; first you
    ' press one of 16 keys to identify the unit you want
    to control,
    ' then you press the key for the action you want that
    unit to
    ' take (turn ON, OFF, Bright, or Dim). There are also
    two group-action
    ' keys, Lights ON and All OFF. Lights ON turns all
    lamp modules on
    ' without affecting appliance modules. All OFF turns
    off all modules,
    ' both lamp and appliance types.

    ' Using XOUT requires a 4-wire (2-I/O pin) connection
    to a PL-513 or
    ' TW-523 X-10 module. See the application note for
    sources.
    zPin con 0 ' Zero-crossing-detect pin from TW523 or
    PL513.
    mPin con 1 ' Modulation-control pin to TW523 or PL513.


    ' X-10 identifies modules by two codes: a House code
    and a Unit code.
    ' By X-10 convention, House codes are A through P and
    Unit codes are
    ' 1 through 16. For programming efficiency, the Stamp
    II treats both
    ' of these as numbers from 0 through 15.
    houseA con 0 ' House code: 0=A, 1=B... 15=P
    Unit1 con 0 ' Unit code: 0=1, 1=2... 15=16
    Unit2 con 1 ' Unit code 1=2.

    ' This first example turns a standard (appliance or
    non-dimmer lamp)
    ' module ON, then OFF. Note that once the Unit code is
    sent, it
    ' need not be repeated--subsequent instructions are
    understood to
    ' be addressed to that unit.

    xout mPin,zPin,[noparse][[/noparse]houseA\Unit1] ' Talk to Unit 1.
    xout mPin,zPin,[noparse][[/noparse]houseA\uniton] ' Tell it to turn ON.
    pause 1000 ' Wait a second.
    xout mPin,zPin,[noparse][[/noparse]houseA\unitoff] ' Tell it to turn
    OFF.

    ' The next example talks to a dimmer module. Dimmers
    go from full
    ' ON to dimmed OFF in 19 steps. Because dimming is
    relative to
    ' the current state of the lamp, the only guaranteed
    way to set a
    ' predefined brightness level is to turn the dimmer
    fully OFF, then
    ' ON, then dim to the desired level. Otherwise, the
    final setting of
    ' the module will depend on its initial brightness
    level.

    xout mPin,zPin,[noparse][[/noparse]houseA\Unit2] ' Talk to Unit 2.

    ' This example shows how to combine X-10 instructions
    into a
    ' single line. We send OFF to the previously
    identified unit (Unit2)
    ' for 2 cycles (the default for non-dimmer commands).
    Then a comma
    ' introduces a second instruction that dims for 10
    cycles. When you
    ' combine instructions, don't leave out the number of
    cycles. The
    ' Stamp may accept your instruction without complaint,
    but it
    ' won't work correctly--it may see the house code as
    the number of
    ' cycles, the instruction as the house code, etc.

    xout mPin,zPin,[noparse][[/noparse]houseA\unitoff\2,houseA\dim\10]

    ' Just to reinforce the idea of combining commands,
    here's the
    ' first example again:

    xout mPin,zPin,[noparse][[/noparse]houseA\Unit1\2,houseA\uniton] ' Turn
    Unit 1 ON.
    pause 1000 ' Wait a second.
    xout mPin,zPin,[noparse][[/noparse]houseA\Unit1\2,houseA\unitoff] ' Turn
    Unit 1 OFF.

    ' End of program.
    stop




    __________________________________________________
    Do you Yahoo!?
    Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
    http://platinum.yahoo.com
  • ArchiverArchiver Posts: 46,084
    edited 2003-03-23 19:10
    --- Leroy Hall <leroy@f...> wrote:
    > Anyone know if there are any sample programs for the
    > X-10 Module controller on
    > the parallax web site at:
    >
    > http://www.parallax.com/detail.asp?product_id=27940
    >
    > ?
    >
    > I am specifically looking for use with a lamp
    > dimming module.
    >
    >
    > thanks,
    >
    > Leroy Hall
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed.
    > Text in the Subject and Body of the message will be
    > ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    > {$STAMP BS2}

    ' Program: X10_DEMO.BS2 (Demonstration of X-10 control
    using Xout)
    ' This program--really two program
    fragments--demonstrates the
    ' syntax and use of the new XOUT command. Basically,
    the command
    ' works like pressing the buttons on an X-10 control
    box; first you
    ' press one of 16 keys to identify the unit you want
    to control,
    ' then you press the key for the action you want that
    unit to
    ' take (turn ON, OFF, Bright, or Dim). There are also
    two group-action
    ' keys, Lights ON and All OFF. Lights ON turns all
    lamp modules on
    ' without affecting appliance modules. All OFF turns
    off all modules,
    ' both lamp and appliance types.

    ' Using XOUT requires a 4-wire (2-I/O pin) connection
    to a PL-513 or
    ' TW-523 X-10 module. See the application note for
    sources.
    zPin con 0 ' Zero-crossing-detect pin from TW523 or
    PL513.
    mPin con 1 ' Modulation-control pin to TW523 or PL513.


    ' X-10 identifies modules by two codes: a House code
    and a Unit code.
    ' By X-10 convention, House codes are A through P and
    Unit codes are
    ' 1 through 16. For programming efficiency, the Stamp
    II treats both
    ' of these as numbers from 0 through 15.
    houseA con 0 ' House code: 0=A, 1=B... 15=P
    Unit1 con 0 ' Unit code: 0=1, 1=2... 15=16
    Unit2 con 1 ' Unit code 1=2.

    ' This first example turns a standard (appliance or
    non-dimmer lamp)
    ' module ON, then OFF. Note that once the Unit code is
    sent, it
    ' need not be repeated--subsequent instructions are
    understood to
    ' be addressed to that unit.

    xout mPin,zPin,[noparse][[/noparse]houseA\Unit1] ' Talk to Unit 1.
    xout mPin,zPin,[noparse][[/noparse]houseA\uniton] ' Tell it to turn ON.
    pause 1000 ' Wait a second.
    xout mPin,zPin,[noparse][[/noparse]houseA\unitoff] ' Tell it to turn
    OFF.

    ' The next example talks to a dimmer module. Dimmers
    go from full
    ' ON to dimmed OFF in 19 steps. Because dimming is
    relative to
    ' the current state of the lamp, the only guaranteed
    way to set a
    ' predefined brightness level is to turn the dimmer
    fully OFF, then
    ' ON, then dim to the desired level. Otherwise, the
    final setting of
    ' the module will depend on its initial brightness
    level.

    xout mPin,zPin,[noparse][[/noparse]houseA\Unit2] ' Talk to Unit 2.

    ' This example shows how to combine X-10 instructions
    into a
    ' single line. We send OFF to the previously
    identified unit (Unit2)
    ' for 2 cycles (the default for non-dimmer commands).
    Then a comma
    ' introduces a second instruction that dims for 10
    cycles. When you
    ' combine instructions, don't leave out the number of
    cycles. The
    ' Stamp may accept your instruction without complaint,
    but it
    ' won't work correctly--it may see the house code as
    the number of
    ' cycles, the instruction as the house code, etc.

    xout mPin,zPin,[noparse][[/noparse]houseA\unitoff\2,houseA\dim\10]

    ' Just to reinforce the idea of combining commands,
    here's the
    ' first example again:

    xout mPin,zPin,[noparse][[/noparse]houseA\Unit1\2,houseA\uniton] ' Turn
    Unit 1 ON.
    pause 1000 ' Wait a second.
    xout mPin,zPin,[noparse][[/noparse]houseA\Unit1\2,houseA\unitoff] ' Turn
    Unit 1 OFF.

    ' End of program.
    stop

    \
    Listing 42.2
    ' Nuts & Volts: Stamp Applications, August 1998


    ' ----[noparse][[/noparse] Title
    ]
    '
    ' File...... PCX10.BS2
    ' Purpose... PC-based X-10 Control via the Stamp II
    ' Author.... Jon Williams
    ' E-mail.... jonwms@a...
    ' WWW....... http://members.aol.com/jonwms
    ' Started... 28 JUN 1998
    ' Updated... 28 JUN 1998


    ' ----[noparse][[/noparse] Program Description
    ]
    '
    ' This program X-10 commands from the pc using the
    StampNet communications
    ' protocol. Actual X-10 control is via the XOUT
    command.
    '
    ' Message structure:
    '
    ' $55 header
    ' addr node address (must be 1 for X-10)
    ' msg HighNib = "F" for X-10, HowNib = house code
    ' pcHigh HighNib = unit code, LowNib = pc X-10
    command
    ' pcLow lamp level for dimmer modules


    ' ----[noparse][[/noparse] Revision History
    ]
    '
    ' 28 JUN 98 : Rev 1


    ' ----[noparse][[/noparse] Constants
    ]
    '
    Baud96 CON 84 ' serial baud rate (to PC)
    SIOPin CON 16 ' use programming port
    ' - couple ATN with capacitor
    mPin CON 0 ' X-10 comm pin
    zPin CON 1 ' X-10 zero-cross pin


    ' ----[noparse][[/noparse] Variables
    ]
    '
    addr VAR Byte ' node address
    msg VAR Byte ' message
    cmd VAR msg.Nib1
    channel VAR msg.Nib0
    pcData VAR Word ' data from pc
    pcHigh VAR pcData.HighByte
    pcLow VAR pcData.LowByte
    sData VAR Word ' return data
    sDHigh VAR sData.HighByte
    sDLow VAR sData.LowByte

    ' X-10 variable mapping
    hCode VAR msg.Nib0 ' X-10 house code (0-15)
    uCode VAR pcHigh.HighNib ' X-10 unit code (0-15)
    x10 VAR pcHigh.LowNib ' X-10 command (1 - 5)
    lmpLvl VAR pcLow ' lamp level (1-19)


    ' ----[noparse][[/noparse] EEPROM Data
    ]
    '


    ' ----[noparse][[/noparse] Initialization
    ]
    '


    ' ----[noparse][[/noparse] Main Code
    ]
    '
    Main: ' wait for message from PC
    SERIN SIOPin, Baud96, [noparse][[/noparse]WAIT ($55), addr, msg, pcHigh,
    pcLow]

    ' ignore bad address or non X-10
    IF (addr <> 1) | (cmd <> $F) THEN Main

    BRANCH x10,[noparse][[/noparse]Main, Unit1, Unit0, All1, All0, SetLvl]
    ' ignore if invalid x-10 command
    ' zero is not valid
    GOTO Main


    ' ----[noparse][[/noparse] Subroutines
    ]
    '

    ' turn selected unit on
    Unit1: XOUT mPin, zPin, [noparse][[/noparse]hCode\uCode\2,hCode\unitOn]
    GOTO Rspnd

    ' turn selected unit off
    Unit0: XOUT mPin, zPin, [noparse][[/noparse]hCode\uCode\2,hCode\unitOff]
    GOTO Rspnd

    ' turn all lamps on
    All1: XOUT mPin, zPin, [noparse][[/noparse]hCode\uCode\2,hCode\lightsOn]
    GOTO Rspnd

    ' turn all units off
    All0: XOUT mPin, zPin, [noparse][[/noparse]hCode\uCode\2,hCode\unitsOff]
    GOTO Rspnd

    ' set light level
    SetLvl: XOUT mPin, zPin, [noparse][[/noparse]hCode\uCode]
    XOUT mPin, zPin, [noparse][[/noparse]hCode\unitOff\2,hCode\dim\lmpLvl]
    GOTO Rspnd

    Rspnd: ' output to PC (x-10 signature)
    SEROUT SIOPin, Baud96, [noparse][[/noparse]"5501F000", 13]
    GOTO Main



    __________________________________________________
    Do you Yahoo!?
    Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
    http://platinum.yahoo.com
  • ArchiverArchiver Posts: 46,084
    edited 2003-03-23 19:51
    --- In basicstamps@yahoogroups.com, "Leroy Hall" <leroy@f...> wrote:
    > Anyone know if there are any sample programs for the X-10 Module
    controller on
    > the parallax web site at:
    >
    > http://www.parallax.com/detail.asp?product_id=27940
    >
    > ?
    >
    > I am specifically looking for use with a lamp dimming module.
    >
    >
    > thanks,>
    > Leroy Hall

    I also found the following link. Hope this helps.

    http://www.parallaxinc.com/Downloads/Documentation/nv/v1/col/NV42-
    Remote_Control_Stamping_-_Part_2.pdf
  • ArchiverArchiver Posts: 46,084
    edited 2003-03-24 16:05
    Thanks Bernard, I appreciate the feedback. SOme of the X-10 modules have two
    way communicaiton potential. Do any of the stamp prgrams take advantage of
    that? Those modules are listed at:

    http://www.gadgethome.com/cgi-local/SoftCart.exe/scstore/p-LM14A.html?L+scstore+
    szgz4531ff863786+1048545620

    thansk,

    Leroy
  • ArchiverArchiver Posts: 46,084
    edited 2003-03-24 16:33
    I've researched the X-10 two-way stuff (TW-523 module, and X10 now
    has a new module for two-way).
    Receiving two-way off the 523 requires listening to the zero-crossing
    signal, and then getting the presence or absence of pulses --
    something the Stamp does not have the speed to do.

    The Basic Atom DOES have X10in commands -- BUT, you have to tell it
    the house code you want to recieve codes for. My desired use was to
    monitor the X10 signals to allow a controller to know what the state
    of X10 commands in the house was -- and the Atom doesn't really
    support this.

    My research has not been exhaustive -- I'd like more input on this
    subject also. AllanL.

    --- In basicstamps@yahoogroups.com, "Leroy Hall" <leroy@f...> wrote:
    > Thanks Bernard, I appreciate the feedback. SOme of the X-10
    modules have two
    > way communicaiton potential. Do any of the stamp prgrams take
    advantage of
    > that? Those modules are listed at:
    >
    > http://www.gadgethome.com/cgi-local/SoftCart.exe/scstore/p-
    LM14A.html?L+scstore+
    > szgz4531ff863786+1048545620
    >
    > thansk,
    >
    > Leroy
  • ArchiverArchiver Posts: 46,084
    edited 2003-03-24 16:53
    Micromint sells both a parallel and serial version of an X-10 chip it calls
    the PLIX http://www.micromint.com/products/chips.htm . I have never used
    either of these chips, but I believe they are capable of handling the two
    way communication between a PC or a microcontroller and a TW523. There are
    some application notes on their site
    http://www.micromint.com/app_notes/plixapp.htm .

    Jack Seppelt
    Original Message
    From: "Leroy Hall" <leroy@f...>
    To: <basicstamps@yahoogroups.com>
    Sent: Monday, March 24, 2003 10:05 AM
    Subject: Re: [noparse][[/noparse]basicstamps] X-10 Module program


    > Thanks Bernard, I appreciate the feedback. SOme of the X-10 modules have
    two
    > way communicaiton potential. Do any of the stamp prgrams take advantage
    of
    > that? Those modules are listed at:
    >
    >
    http://www.gadgethome.com/cgi-local/SoftCart.exe/scstore/p-LM14A.html?L+scst
    ore+
    > szgz4531ff863786+1048545620
    >
    > thansk,
    >
    > Leroy
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-03-24 23:57
    At 04:33 PM 3/24/2003 +0000, you wrote:
    >I've researched the X-10 two-way stuff (TW-523 module, and X10 now
    >has a new module for two-way).
    >Receiving two-way off the 523 requires listening to the zero-crossing
    >signal, and then getting the presence or absence of pulses --
    >something the Stamp does not have the speed to do.

    Knowing nothing about this topic, why is this so? 0-crossing only
    takes place at 120-hZ (in the 60-hZ parts of the world). Seems
    slow, to me .. but then, as I say, I'm sure I'm missing something.

    I'll be getting in to X10 modules soon (not Stamp controlled) for
    ambient lighting control in my new -real- home theatre.
    35mm film, not magnified videos. [noparse]:)[/noparse]

    Thanks!!

    Ron Yost
Sign In or Register to comment.