Using "END" in a subroutine?


Closed Thread
Results 1 to 7 of 7

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    STOP creates an endless loop with a CLRWDT instruction + GOTO back to the label at
    the CLRWDT instruction.

    END creates a loop with a SLEEP instruction + GOTO back to the label at the SLEEP
    instruction.

    Either will work, but END saves power. If you need it to goto sleep and never wake up
    just insert an @ SLEEP at your label, and disable WDT, interrupts, etc..
    Last edited by Bruce; - 13th February 2010 at 15:33.
    Regards,

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

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Talking

    Oops ... forgot the @sleep ...

    Thanks Bruce !
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Thanks Bruce for the insight into the inner workings of STOP and END.

    I forgot about @ sleep.

    Thanks much!


    steve

Similar Threads

  1. Multiple RETURNS within a single subroutine
    By BrianT in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st June 2009, 16:43
  2. Pulsin within subroutine
    By Wesley in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 10th January 2009, 23:05
  3. subroutine with hserin
    By volcane in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 19th December 2007, 02:56
  4. subroutine for picbasic
    By jojokatada in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th February 2005, 18:58
  5. Replies: 0
    Last Post: - 28th May 2004, 17:25

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