HSERIN and XOUT command


Results 1 to 21 of 21

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by aratti View Post
    dhoston, Xin is blocking the USART with and without the timeout
    Code:
    Loop:
    xin X10Rx,ZCrox,[Housekey]
    hSerout ["H: ",#Housekey.byte1,13,10]
    hserout ["K: ",#Housekey.byte0,13,10]
    goto loop
    Your XIN will wait forever for an input. You can add a timeout and label to XIN but it does not solve the problem.

    PBP is not a good choice for doing X10 because of this. You either need a dedicated loop that does nothing but wait for X10 input or risk missing the X10 input. Unless you can write a interrupt routine to check for input 500µS after each ZC you should look for another solution.

    As it happens, I am currently working with the creater of ZBasic to refine its X10 functions. It does X10 input and output in the background automatically, including collision avoidance. The refined version should be available in a couple of weeks.

    The smallest ZBasic chip costs $10 but may not have enough program memory for you. I haven't really analyzed your code.

    ZBasic uses Atmel AVR chips. It has a serial bootloader and a free IDE/compiler. It has a hardware UART and up to 4 full-duplex, interrupt driven, software UARTs that operate in the background. It also has many other features but the smallest chip is 28-pins. http://www.zbasic.net/
    Last edited by dhouston; - 11th May 2009 at 21:11.

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