SERIN timeout


Closed Thread
Results 1 to 3 of 3

Thread: SERIN timeout

  1. #1
    Roger Harrold's Avatar
    Roger Harrold Guest

    Default SERIN timeout

    PICBasic (not PRO)
    Hello, I'm new here, and I'm putting my question in this forum because the PICBasic forum hasn't seen any activity yet.
    Can anyone suggest a way of making SERIN time-out if it receives no characters for a while?

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Here's a few options listed in order of ease of implementation... I'm sure others could add to the list...

    (1) Easiest... Pay for the upgrade to PBP. As you've discovered there's all kinds of goodies missing from PBC which you now wish you had.

    (2) This is really a Fudge... Add an external Watchdog which will force the PIC into Reset if you get get hung-up anywhere (including on the SERIN command).

    (3) Best but also most difficult and time consuming... you'll have to add an Assember Interrupt Handler Routine which will cause you to jump out of the stuck SERIN command and resume execution at a known spot. This will not be a simple task, as you will have to restore the stack and the rest of the environment to what is expected on a normal exit from SERIN. For best implimentation you would probably have to dissassemble a simple program with SERIN embedded to understand what resources its using first, in order to gain an understanding of the best way to time-out of it.

    (4) Write your own SERIN command. Easiest if you have a Hardware USART on your PIC and Microchip then does all the hard work in hardware and you just have to pick up the bytes falling out of the end... Alternatively (a) dissassemble MeLabs SERIN, (b) understand what they're doing, (c) write your own improving on it by incorporating a timeout facility.

    Melanie

  3. #3
    Roger Harrold's Avatar
    Roger Harrold Guest


    Did you find this post helpful? Yes | No

    Default SERIN Timeout

    Thanks for the reply.
    Upgradinf to PB+ would be nice but is not an option right now.
    I couldn't justify the cost for the amount of stuff I have to do.
    The USART route sounds good, and I think I'll investigate that.
    Thanks again.

Similar Threads

  1. Serin timeout not working properly!
    By Megahertz in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 1st January 2010, 20:56
  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 : 1

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