Using multiple SLEEP for long delays ?


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    92

    Default Using multiple SLEEP for long delays ?

    I recently built a gate opener and programmed a 12F675 to control it via wireless remote. I have a 12v Sealed Lead Acid battery as power,

    I've looked at many, many float charger circuits and decided to just program a PIC to close a relay which will allow a trickle charge to top off the battery every, say 100 to 150 hours for a period of about an hour or whatever is needed. (TBD)

    I've tried Darrel's "Elapsed timer" but I can't get it to work in this application, "Ticks" seem to be seconds and "Seconds" seem to be minutes, not sure.

    Anyway, can I just use multiple SLEEP commands of 65,535 seconds (18+ hours) to achieve the desired delay between charging pauses ?

    Or, can anyone suggest a better method ?

    Thanks for any advise

  2. #2
    Join Date
    Sep 2009
    Posts
    737


    Did you find this post helpful? Yes | No

    Default Re: Using multiple SLEEP for long delays ?

    You can, or put SLEEP in FOR loop.

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: Using multiple SLEEP for long delays ?

    Sure, you can use multiple SLEEP periods and keep track of them, just remember that the SLEEP period isn't very accurate and may (will) change with temperature and even from device to device but in your application I don't think it matters if it differes an hour or two in the end.

    There are of course other ways of doing it but, if accuracy isn't an issue, none that is as convenient as SLEEP - not that I can think of anyway.

    /Henrik.

  4. #4
    Join Date
    Mar 2004
    Posts
    92


    Did you find this post helpful? Yes | No

    Default Re: Using multiple SLEEP for long delays ?

    Great, thanks very much guys ! I'll do a FOR/NEXT routine.

Similar Threads

  1. Timer and long (hours) sleep period - how to?
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th January 2007, 07:32
  2. Using RTC to generate long time delays
    By schlaray in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd January 2007, 00:31
  3. long sleep
    By geselaw in forum General
    Replies: 1
    Last Post: - 10th April 2005, 01:31
  4. Long Delays - Is there a valid way?
    By rad in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 29th December 2003, 10:52
  5. FREQOUT delays
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th December 2003, 23:49

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