watch dog timer ?


Closed Thread
Results 1 to 4 of 4
  1. #1

    Default watch dog timer ?

    I am wondering if the wdt will re-start the PIC if prog execution somehow stops,
    is there a way to test the wdt ?

    don
    amgen

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


    Did you find this post helpful? Yes | No

    Default

    I am wondering if the wdt will re-start the PIC if prog execution somehow stops
    Yes. If program execution stops, and you have the WDT enabled, it will cause a reset. That's what it's for.

    There are some exceptions like entering SLEEP, and waking up with the watch-dog timer where it will continue executing code after the sleep instruction, but this is all in the data sheet and easy to lookup.
    is there a way to test the wdt ?
    No, but some PICs have a register that indicates what caused a device reset.
    Regards,

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

  3. #3


    Did you find this post helpful? Yes | No

    Default wdt test

    thanks Bruce,
    I had an idea in the middle of the night that I tried, which seemed to work.
    take a pin and use for an input push-button switch,
    in a PICbasic program, test for sw push then do.........
    asm
    here nop
    goto here
    endasm
    .....a dead end loop with no wdt-reset
    the pic would re-start normal operation after a period and timed out with different settings of wdt timeout.
    it would not be a bad reset type initiated by a push-button.
    don
    amgen

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


    Did you find this post helpful? Yes | No

    Default

    Hi Don,

    Very cool idea. Using the assembler loop, PBP can't reset WDT...;o}

    Edit: I was just thinking. You can force the same timeout period for the WDT reset by inserting a clrwdt instruction just above the loop label. Thanks for sharing the idea. I have something I'm working on now where this works great.
    Last edited by Bruce; - 19th January 2009 at 18:30. Reason: Edit: Another idea
    Regards,

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

Similar Threads

  1. Elapsed Timer Demo
    By Darrel Taylor in forum Code Examples
    Replies: 111
    Last Post: - 29th October 2012, 17:39
  2. Timer + rc5
    By naga in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th November 2009, 07:56
  3. Timer interrupt frequency
    By Samoele in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th January 2009, 23:49
  4. 16F877A won't keep relay on 100% of the time
    By coyotegd in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 10th September 2007, 11:24
  5. PBP and assembler mixing - weird goings-on?
    By Giulio in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th November 2006, 21:17

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