WDT-Reset - How to know


Closed Thread
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289

    Default WDT-Reset - How to know

    Hello,

    we implement the WDT in our code.
    How it is possible to check out, if there was a WDT-Reset ?

    In the init-Part of my code, I check the Bit TO to be cleared and PD to be set (this is the setting after a WDT-Reset), but I think the PicBasic kills them while working on his Reset-Code....

    PIC16F876

    ;Reset ?
    Stat_POR=0:If POR_=0 Then Stat_POR=1:POR_=1
    ;WDT ?
    Stat_WDT=0:IF (TO_=0) AND (PD_=1) Then Stat_WDT=1
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  2. #2
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Default

    I've found the solution

    PicBasic insert CLRWDT-commands, before the TO-Bit is checked. But the CLRWDT-command sets the bit !
    So I use some asm on the first lines of the programm to save the STATUS-register.

    @ movf STATUS,w
    @ movwf _dummy

    ;-)
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

Similar Threads

  1. pic reset sometimes
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 23rd January 2008, 17:27
  2. Changing 18F WDT postscaler on-the-fly
    By Bruce in forum Code Examples
    Replies: 4
    Last Post: - 1st August 2006, 21:09
  3. Software Driven Reset Routine
    By Tissy in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th April 2005, 00:53
  4. reset and interrupt vectors
    By dtoohey in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th February 2005, 22:02
  5. Replies: 5
    Last Post: - 1st December 2004, 12:49

Members who have read this thread : 1

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