• AVR Freaks

Help on watchdog problem

Author
krodev
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2010/01/25 06:47:01
  • Location: 0
  • Status: offline
2019/07/16 03:15:10 (permalink)
0

Help on watchdog problem

I always get watchdog reset, it is like Clrwdt() instruction have no effect.
Configuration bits are :
_FOSCSEL( FNOSC_FRC & IESO_OFF ) ;
_FPOR( FPWRT_PWR128 ) ;
_FWDT( FWDTEN_OFF & WINDIS_OFF & WDTPRE_PR32 & WDTPOST_PS8192 ) ;
In code I placed   _SWDTEN = 1u ;  defined as    #define _SWDTEN RCONbits.SWDTEN 
and many CLRWDT();   defined as   #define macro CLRWDT() {__asm__ volatile ("clrwdt");}
I don't use idle or sleep instructions in my code.
I try different WDTPRE and  WDTPOST setting and I always get reset according to time setting. 
It is really like clwdt instruction does'nt works.
 
Anybody faces same thing ?
 
Denis.
 
 
#1

6 Replies Related Threads

    du00000001
    Just Some Member
    • Total Posts : 2887
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Help on watchdog problem 2019/07/16 04:07:15 (permalink)
    0
    Do yourself a favor: which derivative ?
    (This is just the minimum - more information would certainly help.)

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #2
    du00000001
    Just Some Member
    • Total Posts : 2887
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Help on watchdog problem 2019/07/16 04:11:39 (permalink)
    0
    Or - without understanding what you're doing (the same situation as just now) - try

    _FWDT( FWDTEN_OFF & WINDIS_ON & WDTPRE_PR32 & WDTPOST_PS8192 ) ;


    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #3
    krodev
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2010/01/25 06:47:01
    • Location: 0
    • Status: offline
    Re: Help on watchdog problem 2019/07/16 04:50:06 (permalink)
    0
    du00000001 :
    cpu is dsPIC33FJ128GP306A.
    I will try with  WINDIS_ON   but I am not sure that i can always trig inside the time window. I just want a protection against infinite loop.
     
    #4
    du00000001
    Just Some Member
    • Total Posts : 2887
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Help on watchdog problem 2019/07/16 05:08:27 (permalink)
    4 (2)
    WINDIS_ON equals "WINdowed watchdog DISable ON" (while you currently have the windowed watchdog enabled - leading to an even smaller window where CLRWDT would have a positive effect.

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #5
    oliverb
    Super Member
    • Total Posts : 204
    • Reward points : 0
    • Joined: 2009/02/16 13:12:38
    • Location: 0
    • Status: offline
    Re: Help on watchdog problem 2019/07/16 05:32:12 (permalink)
    4 (2)
    In short "Windowed" watchdog means you can't just put CLRWDT where you like as if it happens too soon it triggers the watchdog, you actually have to schedule clrwdt to occur at reasonably regular intervals, so the watchdog clear falls within the "window". Unless it is mandatory I would suggest sticking with regular non-windowed watchdog.
    #6
    krodev
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2010/01/25 06:47:01
    • Location: 0
    • Status: offline
    Re: Help on watchdog problem 2019/07/16 07:01:42 (permalink)
    0
    Thanks, it works fine with non windowed watchdog
    #7
    Jump to:
    © 2019 APG vNext Commercial Version 4.5