SLEEP, WDT and INT


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    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.

  2. #2
    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?

  3. #3
    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.

  4. #4
    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: - 17th August 2009, 00: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, 10:00
  3. Battery powered applications
    By NavMicroSystems in forum Off Topic
    Replies: 7
    Last Post: - 22nd June 2009, 08: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, 03:35
  5. Wierd sleep issue
    By orca in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th March 2006, 23: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