? about sleep/wake on pin change and WDT


Results 1 to 13 of 13

Threaded View

  1. #9
    Join Date
    Jan 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    No Jerson, I'm trying to get it to pulsout as the main function every few seconds or so. I want it to sleep as if it were turned off. And then continue its normal function pulsing when awakened.

    I have tried your suggestion tho Bruce and come up with this code:

    __________________________________________________ ____________

    TRISIO=%11111111
    STATUS=%10010000
    OPTION_REG=%00001000
    check var bit
    Low GPIO.0

    loop:

    nap 4
    pulsout 0, 4000
    nap 5

    IF GPIO.1 = 1 then
    suspend:
    pause 2000
    check = GPIO
    sleep 65535
    IF GPIO.1 = 1 then
    goto loop
    else
    goto suspend
    endif
    endif

    goto loop
    __________________________________________________ _____________

    This seems to work. It wakes and sleeps on pin change just fine... however my problem now is that its drawing some 60uA instead of the 5-10uA listed in the datasheet. I'll keep looking through to see if there is something else I can do to lower the current drain, but for now this seems to be as close as I am going to get.

    I DID notice however that GPIO 3 is constantly high... this could have something to do with current drain being slightly higher so that is what I am currently looking into.

    Again thanks for the Input guys.

    P.S. This is on a PIC10F202 and I am using MPLAB IDE v7.11
    Last edited by kessral; - 15th January 2007 at 21:11.

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 : 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