Interrupts and Sleep help 16f818


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: Interrupts and Sleep help 16f818

    Just had a play with this….

    Sorted a few problems out around the sleep…. Still got issues jumping out of the main loop to go to sleep…But the sleep works !!

  2. #2
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229


    Did you find this post helpful? Yes | No

    Default Re: Interrupts and Sleep help 16f818

    Andy,

    You can encase your mainloop code in a Do/Loop While with a test of the WakeupFlag.
    Then when the WakeupFlag is set at timeout, the loop will terminate and you can replace the "GOTO mainloop" instruction with a GOTO bedtime as the last instruction of mainloop.

    Or

    You can use a Do/Loop with an "Exit" statement in place of the "GOTO bedtime" instruction in the timeout1 If/Then test. Still replace the "GOTO mainloop" instruction with a "GOTO bedtime" instruction as the last instruction in mainloop.

    Also, I overlooked the fact that you are jumping to CACHE twice a day and CACHE falls through to bedtime without setting the WakeupFlag. You shou set the WakeupFlag before you jump to CACHE.

    What kind of problems are you having?
    Last edited by Tabsoft; - 7th March 2015 at 22:02.
    Regards,
    TABSoft

Similar Threads

  1. 16f818 from 16f628a
    By andybarrett1 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th August 2014, 07:31
  2. Basic problem with interrupts and sleep command
    By Davidmarks in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 21st February 2012, 01:21
  3. Replies: 3
    Last Post: - 6th November 2011, 19:33
  4. Replies: 0
    Last Post: - 26th June 2010, 17:52
  5. @ SLEEP with interrupts 16F88
    By drewlash in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 11th February 2005, 05:55

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts