@sleep


Closed Thread
Results 1 to 9 of 9

Thread: @sleep

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    If you're using the Assembler @ SLEEP, the WDT needs to be Disabled (OFF).

  2. #2
    jheissjr's Avatar
    jheissjr Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Melanie,

    I agree that the Watch Dog needs to be disabled. I used this line which I thought should do it:

    @CONFIG.2 = 0 ' 0=Watch Dog Off

    Also tried this too
    @ CONFIG.2 = 0 ' 0=Watch Dog Off

    Maybe the order or location which I have the line is not correct? Or if I try disabling the watch dog using either of these two lines instead of @CONFIG.2=0, I get an 'Illegal Opcode (WDT_OFF)' error from MPASM.

    @DEVICE WDT_OFF => Illegal Opcode (WDT_OFF)
    @ DEVICE WDT_OFF => Illegal Opcode (WDT_OFF)

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    WDT is usually controlled from the Config Fuse definitions...

    http://www.picbasic.co.uk/forum/showthread.php?t=543

    Although Microchip have recently started tinkering with the CONFIG statement, so look in MPLABS HELP file for the latest syntax. Whn I've time I'll update that thread... or perhaps someone else might want to tag the latest MPASM amendments onto it...

  4. #4
    jheissjr's Avatar
    jheissjr Guest


    Did you find this post helpful? Yes | No

    Default

    In the datasheet it says "If the device is in Sleep mode, a WDT time out causes the device to wake up and continue with normal operation."

    The next line says "The Watch Dog can be permanently disabled by programming the configuration bit WDTE as clear." That is just what I have in my code (CONFIG.2 = 0) yet the PIC is still resetting itself.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Have you checked that when you burn your PIC, the WDT is set to OFF in your programming software?

  6. #6
    jheissjr's Avatar
    jheissjr Guest


    Did you find this post helpful? Yes | No

    Default

    This is why I love the forum. That was the problem! Just incase anyone is using ICPROG and encounters this same problem, you have to uncheck the WDT check box. Thank you Melanie!

Similar Threads

  1. 12c508 @sleep command?
    By rtsandiego in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 14th January 2004, 06:59

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