Putting PIC18F to sleep for a long time

Author
MauroMartins
Junior Member
  • Total Posts : 102
  • Reward points : 0
  • Joined: 2009/01/15 04:20:54
  • Location: 0
  • Status: offline
2013/09/02 02:42:37 (permalink)
0

Putting PIC18F to sleep for a long time

Hello all, 
 
I would like to know how can I use the sleep for very long time periods.
 
Imagine I need to put pic to sleep for about two hours, currently I'm using the watchdog timer to wake up from sleep but even with maximum prescaler I can only get a couple of minutes.
 
What strategies should I use in order to achive long time sleep periods between wake-ups?
 
Thanks in advanced,
 
Best regards, Mauro.
 
 
#1

8 Replies Related Threads

    Ian.M
    Super Member
    • Total Posts : 13040
    • Reward points : 0
    • Joined: 2009/07/23 07:02:40
    • Location: UK
    • Status: offline
    Re:Putting PIC18F to sleep for a long time 2013/09/02 02:56:27 (permalink)
    0
    External RTC chip with alarm output to interrupt pin on PIC?
    #2
    maxruben
    Super Member
    • Total Posts : 3072
    • Reward points : 0
    • Joined: 2011/02/22 03:35:11
    • Location: Sweden
    • Status: offline
    Re:Putting PIC18F to sleep for a long time 2013/09/02 02:59:26 (permalink)
    +2 (1)
    Count the number of WDT interrupts, if not time to wake up yet, immediately go to sleep again.
     
    /Ruben
     
    #3
    Chris A
    Super Member
    • Total Posts : 743
    • Reward points : 0
    • Joined: 2010/07/20 04:37:07
    • Location: 0
    • Status: offline
    Re:Putting PIC18F to sleep for a long time 2013/09/02 03:01:20 (permalink)
    0
    Use a software counter to extend the period.  Does the little power that is used to wake up every few 10 seconds really matter?  Calculate it. 
    You could also select the 32K INTRC as the CPU clock before sleep so that when it does wake, it is still using very little anyway.  Then after 2 hours, stay away and switch to a faster clock if required.
    #4
    MauroMartins
    Junior Member
    • Total Posts : 102
    • Reward points : 0
    • Joined: 2009/01/15 04:20:54
    • Location: 0
    • Status: offline
    Re:Putting PIC18F to sleep for a long time 2013/09/02 03:12:08 (permalink)
    0
    Hello all, 
     
    thank you for your messages.
     
    I've already thought on using the RTC (because the application also needs it).
     
    Counting the WDT interrups is also doable but, I really need to see what is the impact on consumption.
     
    Migrating for pic24 would be any good for this situation? in other words, would pic24 hardware offer better solutions? for example using the internal Calendar or something similar?
     
    Best regards, Mauro.
    #5
    DarioG
    Scheisse Menschen
    • Total Posts : 52257
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: hi there
    • Status: offline
    Re:Putting PIC18F to sleep for a long time 2013/09/02 06:18:07 (permalink)
    0
    Yeah, I'd agree in that a few uSecs out of 2 minutes (just to increase and compare a counter) should have a very very little impact upon consumption.

    Dario Greggio
    --
    Wouldn't it be wonderful, if you lost one son for every promise you don't keep?
    #6
    tom maier
    Super Member
    • Total Posts : 2116
    • Reward points : 0
    • Joined: 2013/08/22 15:27:12
    • Location: earth
    • Status: offline
    Re:Putting PIC18F to sleep for a long time 2013/09/02 06:18:11 (permalink)
    +2 (1)
    "Counting the WDT interrups is also doable but, I really need to see what is the impact on consumption. "
     
    I think if you do the math, you will find that the periodic wakeups are insignificant to your total power consumption.
     
    For example, if you wake up for 20 useconds every 10 seconds, then you have a ratio of (20e-6/10). That's a 99.9998% of time spent in sleep. Will you really save a significant amount of power by striving for 100%?
     
    By the way, remember that the WDT is RC controlled, so it is not accurate in time and can vary significantly with temperature.
     
    #7
    MauroMartins
    Junior Member
    • Total Posts : 102
    • Reward points : 0
    • Joined: 2009/01/15 04:20:54
    • Location: 0
    • Status: offline
    Re:Putting PIC18F to sleep for a long time 2013/09/02 08:25:00 (permalink)
    0
    Hello Again, 
     
    Thank you all for your replies!
     
    possibly the solution that I'll use will be the RTC because I need it for my application. 
    But I'll save this information regarding waking up and add a counter for future applications where a RTC won't be needed.
     
    As for higher pics, is there any added value using them for this purpose?
     
    Best regards, Mauro.
     
     
     
     
    #8
    NKurzman
    A Guy on the Net
    • Total Posts : 14678
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re:Putting PIC18F to sleep for a long time 2013/09/02 11:13:48 (permalink)
    +2 (1)
    The newr PIC18 chips can WDT in 4 minutes .  Setting a count an going right back to sleep uses very little power.
    Again the sleep current depends on the chip.
    You would need to see what the sleep current on a PIC24 is to see if the total is lower.
    #9
    Jump to:
    © 2017 APG vNext Commercial Version 4.5