Serin timeout not working properly!


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Location
    London
    Posts
    251

    Exclamation Serin timeout not working properly!

    Happy New Year To everyone.
    I am facing a small problem of Serin command. The timeout function is not working correctly. (Using 12F635 with WDT_OFF)

    Code:
    Main:
    high led : pause 50 : low led
    Serin FromRx,N2400,200,["pp3"],code
    .....rest fo the code here
    My led should blink 50mS ON & appx 200mS OFF when no data is comming from my RF Receiver. But this is not happening. Can someone help please? Thanks

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Hi Megahertz,

    If you want the LED to blink while waiting for input you must jump to your “Main” label after the timeout. Read the Serin command for more information.

    HTH

    Nick

  3. #3
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Nicmus View Post
    Hi Megahertz,

    If you want the LED to blink while waiting for input you must jump to your “Main” label after the timeout. Read the Serin command for more information.

    HTH

    Nick
    Hello Nick, that is the problem. The serin command is not working as expected.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    It only jumps to a timeout label if you tell it where the label is.
    Code:
    Main:
    high led : pause 50 : low led
    Serin FromRx,N2400,200,Main,["pp3"],code
    .....rest fo the code here
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Question

    Sorry for the code, I have missed the *Main* while writing the question. It actually is there in my code.
    I will correct my code statements to the following:

    Code:
    Main:
    high led : pause 50 : low led
    Serin FromRx,N2400,200,Main,["pp3"],code
    .....rest of the code here
    goto Main
    The code enters main label and led blinks, but then it stops. I expect it to blink after every 200mS which is not happening.

    Couple of times this happened as well that program entered main label, led blinked few times lets say 5 or 6 after every 200mS but then it stopped again.

    I cannot understand this erratic behaviour of my PIC.

  6. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    The timeout period gets continuously reset if there's noise on the serial input pin. If you're trying to use this option with a noisy RF receiver, the timeout/label approach isn't going to work.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. SERIN timeout
    By Del Tapparo in forum Serial
    Replies: 3
    Last Post: - 20th November 2007, 04:34
  2. SERIN Timeout
    By George in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 23rd March 2007, 15:06
  3. 16F628A Serin timeout and Timer1
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th March 2006, 23:20
  4. SERIN SERIN2 Timeout
    By markedwards in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd June 2005, 18:59
  5. SERIN & Timeout
    By BigWumpus in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th October 2004, 07:33

Members who have read this thread : 3

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