Sleep Mode question


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2010
    Posts
    409

    Default Sleep Mode question

    Well, I've plowed the manual until my eyes are blurry with no joy, so I thought I'd ask the experts:

    I'm using an 18F2580. I have an external device that every once in awhile toggles asynchronously. I'm using the Timer3 input to count those toggles. Everything works as expected.

    Now I'd like to save some power. If I put the device to sleep for 30 seconds will it miss toggles on the Timer3 input while sleeping, or not?

    Thanks for any insight - testing it is sort of painful because of the board layout, but track cutting might be my next step after this...

  2. #2
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Sleep Mode question

    As I understand it you will miss it, unless you are using an interrupt to wake the device when the pin is toggled.
    Shawn

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


    Did you find this post helpful? Yes | No

    Default Re: Sleep Mode question

    Hi,
    With TMR3 configured as a counter I would think you should 'get' the count. However the datasheet isn't really clear on this as far as I can see. It does say that, when entering sleep, all peripherals are shut down so perhaps it'll stop working even if configured as a counter. If configured as a timer it'll definitely stop since the main oscillator is shut down when in sleep.

    If it turns out that TMR3 stops counting when in sleep you could try OSCON.7 = 1 which, when the SLEEP instruction is executed puts the processor in Idle mode instead of sleep. In idle mode the CPU is shut down but the peripherals are kept ON. Draws a bit more current obviously but what are going to do.... Make sure you read up on the various idle-modes available. But again, I think you should be fine when configured as a counter.

    /Henrik.

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,611


    Did you find this post helpful? Yes | No

    Default Re: Sleep Mode question

    Hi,

    probably you could do something interesting with comparators that can wake up your device ... as you stated toggling happens @ a very very very low rate ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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