X10 commands and PBP


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    May 2008
    Location
    Italy
    Posts
    825

    Default X10 commands and PBP

    Several months ago, I did post for a problem faced with the XIN instruction, in conjunction with HSEROUT. Well after several experiments I came to the conclusion that HSEROUT has nothing to do with the problem, which depend exclusively on the XIN instruction! which doesn't work properly.

    I tested XIN with several different pics (16F84; 16F88; 16F628; 16F876) and the XIN instruction fails to work with them all.

    Sending an X10 command, the X10 device addressed, respond as it should while the testing device (which shold read the same command with the XIN instruction) reports always Home 17 and Key 10 whatever X10 command is sent.

    On the contrary the XOUT instruction works correctly.(using the same powerline interface)

    I wonder to who, I must address this issue to see if it is possible to remove the problem and be able to use the XIN instruction.

    Any suggestion is welcome.

    P.S. (I have PBP 2.47)

    Al.
    Last edited by aratti; - 14th November 2009 at 17:28.
    All progress began with an idea

  2. #2
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Are you using the TW523 interface or your own hardware to receive X10 from the mains?

    Anand

  3. #3
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    No, I am using TR-2A Tx & Rx powerline.

    Al.
    All progress began with an idea

  4. #4
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by aratti View Post
    No, I am using TR-2A Tx & Rx powerline.
    Is that from Iriave? I have a TR-1A (IiRC) from 5-6 years ago. Do you have any documentation for your module?

    EDIT: http://www.iriave.it/Datasheet/TR-2ArevB.pdf

    It looks very similar to the TR-1A that I have (somewhere). They use a reed relay to disconnect the TX circuit when idle to avoid loading the network and attenuating other transmitters. Anand's advice re 50Hz is likely spot on.
    Last edited by dhouston; - 15th November 2009 at 03:29.

  5. #5
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    The reason I asked was, the delays incorporated in PBP for X10 commands assume a 60 Hz system; if you are in a 50 Hz country, you might have to tweak some values in the XIN and XOUT routines in the .lib files, especially if your transmitter and receiver are not on the same phase.

    When I design around X10 (my hardware directly interfaces with the mains), I do use the XOUT, but for receiving I decode the incoming signal manually.

    What I'd suggest is, record the zerp crossing signals on one channel and the X10 signals on the other channel using your sound card, and see what you're actually getting. Confirm if the X10 bits are withing the tolerated delay of a true zero crossing. Decode the bit stream to see if it matches the transmitted signal. That would be a starting point.

    Regards,

    Anand

  6. #6
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Thanks, Dave.

    Aratti, with the interface PBP is designed to work with (TW 523 or equal), the transmitter is a simple physical interface to the mains. However, the reception goes thru' a processor that outputs a string PBP can recognise.

    I am not familiar with the TR-2A, and could not find a schematic, but page 4 of the pdf suggests that the reception is also a simple physical interface that translates 120khz bursts to '1'; no processing is done, just the raw data received is sent to the host at TTL levels. In which case, XIN will not work. You will have to decode the bits manually, which s incidentally not too complex given all the X10 documentation on the web.

    Regards,

    Anand

  7. #7
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    dhouston wrote: ..... Is that from Iriave? I have a TR-1A (IiRC)
    Dave,
    Yes, Iriave is the manufacturer, very likely TR-2A is the updated version of the TR-1A. The reed is anabled before X10 Tx and disable at the end. This works fine and I can Tx out all X10 codes. The problem is the X10 Rx which is reading the same value whatever X10 code you burst on the main. We have 50 Hz, (which should be better, since we have longer time for the burst, 10 millisec delay among zerocrossing while 60 hz has 8.33 millisecs).

    ardhuru wrote: .....The reason I asked was, the delays incorporated in PBP for X10 commands assume a 60 Hz system; if you are in a 50 Hz country, you might have to tweak some values in the XIN and XOUT routines in the .lib files, especially if your transmitter and receiver are not on the same phase.
    ardhuru, I don't think the main frequency matter, otherwhise I should not be able to burst out with the XOUT instruction.

    ardhuru wrote: ..... When I design around X10 (my hardware directly interfaces with the mains), I do use the XOUT, but for receiving I decode the incoming signal manually.
    if I read correctly your words, you did already experiment XIN without success, so you solved the problem decoding the X10 burst writing your own Rx routine. More explicitely "XIN instruction doesn't work" and forget about fixing PBP XIN instruction, write your own Rx routine.

    Sounds very wise and realistic.

    Thank you very much for your posting.

    Al.
    Last edited by aratti; - 15th November 2009 at 09:19.
    All progress began with an idea

  8. #8
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    After sleeping on it...

    The TR-1A may have been a prototype. It output the 120kHz bursts rather than the data envelope as the TR-2A does.

    50Hz should not be a problem for RX since you are only interested in the 120kHz burst that immediately follows ZC. But, I have never tried XIN so cannot offer anything meaningful.

    If this is a one-off project, I would suggest a different chip. The ZBasic ZX328n sells for $10 plus the cost of the interface board and parts kit (plus shipping from the USA) but it has built-in low level interrupt driven X10 routines operating in the background. It has a serial bootloader making it easier to develop your program.

    If it's a commercial project, I'd follow Anand's advice.

  9. #9
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by aratti View Post
    you did already experiment XIN without success, so you solved the problem decoding the X10 burst writing your own Rx routine.
    Without success, if I interfaced the circuit directly with the mains, *without* a TW523. Yes, I did manage to decode the signal with my own routine, rather than XIN.

    Quote Originally Posted by aratti View Post
    More explicitely "XIN instruction doesn't work" and forget about fixing PBP XIN instruction, write your own Rx routine.
    Not quite true; XIN does work, only when used with a TW523.

    http://www.x10.com/products/x10_tw523.htm

    Regards,

    Anand

  10. #10
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    There are some other reasons to write your own routines. The TW523 delays its output for 22 half-cycles of the powerline (so it can validate the commands) and it only outputs if the commands are valid. This saves you the trouble of checking the manchester coded commands but also means your processor is deaf to the powerline while the previously received command is being output. The 22 half-cycle periods of deafness mean you miss 2/3 of dim/bright commands and cannot receive X-10's extended commands. Most importantly, the TW523 cannot avoid collisions as it is not operating in real time - it can only detect them after the fact. The TW523 was designed about 30 years ago and uses outmoded technology.

    XIN assumes a TW523 so it does not handle extended codes.
    XIN may also be expecting a silence after 22 half-cycles and is being confused by the continued output from the TR-2A.

    The TR-2A operates in real time so you need not miss any powerline activity. You can avoid collisions but you will also need to check the manchester validity of received commands.

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 12:55
  2. PBP Extensions, What are they?
    By PJALM in forum PBP Extensions
    Replies: 9
    Last Post: - 28th September 2021, 11:26
  3. Sending Commands from Visual Basic about IR to Pic
    By tne_de in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th April 2009, 06:09
  4. PBP - are DEFINE command(s) mandatory?
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 15th September 2006, 16:43
  5. WRITE not working
    By servo260 in forum mel PIC BASIC Pro
    Replies: 31
    Last Post: - 29th December 2004, 02:02

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts