View previous topic :: View next topic |
Author |
Message |
guest110 Guest
|
WDT confusion |
Posted: Tue Feb 19, 2008 2:59 pm |
|
|
Hello,
I am using a PIC18F4685. There is a possibilty of an endless loop (based in some external hardware) I want to activate the WDT only at this time. Can I use set_up_wdt(wdt_on) and set_up_wdt(WDT_OFF) to selectively activate and deactivate the watch dog? If this is true what is the proper fuse setting NOWDT or WDT ?
Thanks for any help |
|
|
Bob Sacamano
Joined: 17 Jan 2008 Posts: 16 Location: Somewhere Cold, USA
|
|
Posted: Tue Feb 19, 2008 3:25 pm |
|
|
From the datasheet:
Quote: | PIC18F2682/2685/4682/
4685 devices have a Watchdog Timer, which is either
permanently enabled via the Configuration bits or
software controlled (if configured as disabled). |
and also
Quote: | SWDTEN: Software Controlled Watchdog Timer Enable bit(1)
1 = Watchdog Timer is on
0 = Watchdog Timer is off
Note 1: This bit has no effect if the Configuration bit, WDTEN, is enabled. |
and finally
Quote: | bit 0 WDTEN: Watchdog Timer Enable bit
1 = WDT enabled
0 = WDT disabled (control is placed on the SWDTEN bit) |
So if you use the NOWDT fuse, then the WDT is software controlled.
If you use the WDT fuse, then the WDT is permanently enabled.
This was an especially confusing point for me to remember when I first started using these PICs. The naming convention of the configuration bit/fuse setting is a bit peculiar at best. _________________ "And you want to be my latex salesman." |
|
|
guest100 Guest
|
|
Posted: Tue Feb 19, 2008 3:55 pm |
|
|
thanks seinfeld fan |
|
|
|