What commands reset the WDT?


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2010
    Posts
    8

    Default What commands reset the WDT?

    The problem is that I have never actually cleared the WDT in the code...but I've never seen it time out and reset the chip. I never intended to use the WDT with this application, but since its enabled by default, I never gave it a second thought. Could there be other commands that reset the WTD besides NAP, SLEEP, or CLEARWDT?

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Here is some info on the WDT from the manual.

    The Watchdog Timer is used in conjunction with the SLEEP and NAP
    instructions to wake the PIC MCU after a certain period of time.
    Assembler instructions (clrwdt) to keep the Watchdog Timer from timing
    out under normal circumstances and resetting the PIC MCU are
    automatically inserted at appropriate places throughout the program.
    CLEARWDT allows the placement of additional clrwdt instructions in the
    program.

    The Watchdog Timer is enabled by PBP. It is used, along with the TMR0
    prescaler, to support the NAP and SLEEP instructions. If neither of the
    instructions are used in a program, the Watchdog Timer may be disabled
    and the prescaler used for something else.

    If you want to tell PBP not to automatically insert the clrwdt instructions, you can use this define, and insert them yourself.

    DEFINE NO_CLRWDT 1 ‘ Don’t insert CLRWDTs

    But if you don't want to use it at all, you must turn it off in the configs.
    Last edited by ScaleRobotics; - 4th November 2010 at 15:17.
    http://www.scalerobotics.com

  3. #3
    Join Date
    Nov 2010
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    Thanks for the information, this clears up a lot of issues

  4. #4
    Join Date
    Nov 2010
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    Another question: When/where does it decide to place these clears in the code? Im looking through the .asm file and I cannot find anything that looks like it.

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