Timing And Loop Fundamentals


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,623


    Did you find this post helpful? Yes | No

    Default Re: Timing And Loop Fundamentals

    Hi,
    When you put the PIC to sleep the main oscillator shuts down. If the timer you're using to generate the interrupt is clocked from the main oscillator (ie you're not clocking it from an external source) then the timer stops incrementing and will never overflow thus never generating the interrupt that's supposed to wake the PIC up again.

    There are several possible ways to do what you want, I'm going to sugest one here. TMR1 has its own oscillator which can be driven by an external x-tal, for example a 32.768kHz clock x-tal. When clocked externally it won't stop counting when the rest of the PIC goes to sleep so the interrupt caused by the timer overflow will wake it up.

    Depending on the PIC you're using there may be various power managed mode, for example Idle. In Idle mode the CPU core is shut down but any enabled peripherals such as the timer(s) are still clocked. Take a look at the Power Managed Modes section in the datasheet for the particular PIC you're using.

    /Henrik.
    Last edited by HenrikOlsson; - 28th June 2011 at 18:52.

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