? about sleep/wake on pin change and WDT


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Posts
    15

    Default ? about sleep/wake on pin change and WDT

    I am making a device using the pic10f series microcontrollers whose main purpose is to do a pulsout every couple of seconds. I want it to pulsout and then NAP (go into low power mode between pulses for less than a second to maybe 2 seconds). This is easy.

    However, I need to be able to put it to sleep and wake it up on pin change (using a magnetic switch internally sealed from elements) which requires that the WDT be disabled. I am using watch batteries (due to size restrictions) I really need for it to have the lowest power consumption possible AT ALL TIMES. NAP will not work without WDT enabled.

    What else can I do, any suggestions?

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Use the assembler @ SLEEP option & WDT to wake up periodically and
    generate your pulse. Using the prescaler you can have up to 2.3 second
    sleep periods.

    Use one I/O-pin to wake up on keypress, and another to enter sleep mode
    when pressed.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Jan 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Thanks for your reply but.... Unfortunately I want to be able to just wave the magnet over the switch which will change the pin state and make the pic sleep or wake. I cannot leave the magnet in place on the magnetic switch.

    So I need the pic to stay sleeping after an "@ SLEEP" and not to wake at all until the pin changes when the magnet has been waved over the switch.

    This means the WDT has to be disabled which kills my "NAP" or "SLEEP" usage and forces me to use pause which will not be the low power usage desired.

    Anything else I could try at all?

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Is the magnetic switch the "only" thing that will be used to wake it up?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Jan 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Yes, the magnetic switch will be the ony thing to wake it and tell it to sleep in this application. It should not turn on/off (wake/sleep) until a user turns it or on with the switch..

  6. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Here's one scenario;

    The PIC wakes up at regular intervals using the WDT. If switch = 0, then go
    back to sleep. It's only awake for a few uS testing the switch.

    If switch = 1, then do whatever you need to do, then test the switch input
    before going back to sleep.

    A switch press can also wake the PIC up before a WDT timeout. Handle
    whatever you need to do, test the switch, and go back to sleep or stay
    awake (resetting WDT) as required, based on the switch input.

    It's still going to save a boat-load of power since it will be sleeping until your
    switch is active, or the WDT times out.

    If the switch isn't active, it's still alseep for the majority of time, and you'll
    be operating at low current until the switch input forces the wake up, or the
    WDT timeout.

    Wouldn't that work?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. saving RCREG to word
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th September 2008, 13:51
  2. Changing 18F WDT postscaler on-the-fly
    By Bruce in forum Code Examples
    Replies: 4
    Last Post: - 1st August 2006, 21:09

Members who have read this thread : 2

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