CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

WDT confusion

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
guest110
Guest







WDT confusion
PostPosted: Tue Feb 19, 2008 2:59 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Feb 19, 2008 3:25 pm     Reply with quote

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







PostPosted: Tue Feb 19, 2008 3:55 pm     Reply with quote

thanks seinfeld fan
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group