SLEEP, WDT and INT


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Sure, just turn off the WDT in the configs.

    Then when you put it to sleep, it will stay that way until an interrupt is triggered.

    You can use ...
    Code:
    @  SLEEP
    and you won't need to enter a period.
    <br>
    DT

  2. #2
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Sure, just turn off the WDT in the configs.

    Then when you put it to sleep, it will stay that way until an interrupt is triggered.

    You can use ...
    Code:
    @  SLEEP
    and you won't need to enter a period.
    <br>
    Do I need to use
    @ sleep
    ?
    With PBP, can I use something like:

    loop:
    sleep
    goto loop

    ?

    (I always disable WDT in the config words).

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yes you can do something like that... but the assembler line @ sleep will send your PIC in sleep mode forever... or 'till an interrupt happen. PBP SLEEP will send your PIC in sleep mode for a x period of time and then wake up. It's really up to you. I prefer the @ SLEEP
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by mister_e View Post
    Yes you can do something like that... but the assembler line @ sleep will send your PIC in sleep mode forever... or 'till an interrupt happen. PBP SLEEP will send your PIC in sleep mode for a x period of time and then wake up. It's really up to you. I prefer the @ SLEEP
    Thanks you all.

    So I can use something like:


    ON INTERRUPT GOTO myinthandler

    start:
    @ sleep


    myinthandler:
    ...

    In this case my main program is only the @sleep instruction and once the int has been processed, it goes back to sleep until next interrupt, is that right?

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Yes, that should work.
    This thread has some good info of the ins and outs
    http://www.picbasic.co.uk/forum/show...ighlight=sleep
    Read post #3
    Dave
    Always wear safety glasses while programming.

  6. #6
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks a lot!

Similar Threads

  1. Pin won't stay high during Repeat...Until loop??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th August 2009, 23:57
  2. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 09:00
  3. Battery powered applications
    By NavMicroSystems in forum Off Topic
    Replies: 7
    Last Post: - 22nd June 2009, 07:12
  4. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 02:35
  5. Wierd sleep issue
    By orca in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th March 2006, 22:06

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