Timer and long (hours) sleep period - how to?


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex View Post
    Thanks a lot Skimask for your support.

    I'm going to try with TMR1.

    A little more power is maybe worth the precision gain.

    Thank you.
    You could add in a RTC chip, and wake up just a bit more often and compare the RTC's time with what you expected and adjust your nap/sleep time to get you really close to 15 minutes, or even use the RTC's alarm function (usually tied to a pin) to wake up the PIC at intervals. RTC chips use hardly any power except when awake and I'd suspect that adding an RTC would use much less power than adding another oscillator to a PIC.

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Hi Flotul. I've used a code similar to this in the past and found it to be accurate within 2 minutes per hour using the internal oscillator set to 4 MHZ. Also, I operated it at 3V (using an LF series PIC), current consumption was only 1/2 mA and runs a long time on 2AA alkaline batteries.


    x var word
    let x = 0

    start:
    pause 1000
    let x = x + 1
    if x >= 900 then (15 minutes passed, do your measurement)
    goto start

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Yes - possible alternatives

    Thank you for your suggestions.

    Two minutes may look acceptable in some cases but if you have to record datas over days and weeks, it's is no more accurate enough.

    I'll have to make some tries but, as said by skimask, an RTC is maybe the best choice after all.

    Thanks again.
    Roger

Similar Threads

  1. Elapsed Timer Demo
    By Darrel Taylor in forum Code Examples
    Replies: 111
    Last Post: - 29th October 2012, 17:39
  2. High Resolution Timer & Speed Calculator
    By WOZZY-2010 in forum Code Examples
    Replies: 4
    Last Post: - 7th February 2010, 16:45
  3. Replies: 5
    Last Post: - 24th February 2009, 18:55
  4. long countdown timer, how to save power?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 15th November 2008, 05:15
  5. Long Timer
    By Tissy in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 1st November 2005, 17:24

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