Cannot wake from SLEEP


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191


    Did you find this post helpful? Yes | No

    Default Re: Cannot wake from SLEEP

    How about WDT_ON_2H in CONFIG?
    PICs CONFIGS
    Last edited by Gusse; - 20th May 2013 at 12:06.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Cannot wake from SLEEP

    I am using PBP3.0.1.4 with MCSPX 5.0.0.5

    I set the config state through the drop down [C] button that pops up whenever I do a 'compile/program'. There is no choice to set WDT_ON_2H.

    Is WDT_ON_2H a valid directive for a PIC18F4620?

  3. #3
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191


    Did you find this post helpful? Yes | No

    Default Re: Cannot wake from SLEEP

    Yes it is. Below is part of PIC18F4620.PBPINC from device -folder.

    Code:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;  The #CONFIG block is passed directly to the asm file, but PBP will replace it
    ;  automagically with the contents of a user-defined #CONFIG block if one is
    ;  found in the PBP source program.  There is no need to edit or comment this 
    ;  block in this file.  Simply copy it to your source program and edit it there.
    
    #CONFIG
            __CONFIG    _CONFIG1H, _OSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
            __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
            __CONFIG    _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
            __CONFIG    _CONFIG4L,  _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L
    #ENDCONFIG
    This is example that I have used with PIC18F4520 and it might be just fine for you too. If not, then change according to your needs.
    At least sleep & nap are working OK, also with interrupt. Check right parameters for CONFIGS from link that I sent earlier (credits to Demon).
    Code:
    #CONFIG
        __CONFIG    _CONFIG1H, _OSC_INTIO67_1H 
        __CONFIG    _CONFIG2L, _PWRT_ON_2L & _BOREN_OFF_2L
        __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
        __CONFIG    _CONFIG3H, _PBADEN_OFF_3H
        __CONFIG    _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
    #ENDCONFIG
    Last edited by Gusse; - 21st May 2013 at 08:52.

Similar Threads

  1. Wake from sleep with USB Interrupt
    By kduck63 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th January 2013, 01:59
  2. 16F690... How to wake from sleep?
    By Heckler in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th July 2011, 23:07
  3. 16F181: can't wake up from sleep
    By Navaidstech in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th January 2010, 05:33
  4. wake up from sleep
    By savnik in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 31st August 2007, 18:09
  5. ? about sleep/wake on pin change and WDT
    By kessral in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 26th January 2007, 00:25

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