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 CCS Technical Support

WDT doesn't work

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



Joined: 07 Jan 2013
Posts: 31

View user's profile Send private message

WDT doesn't work
PostPosted: Wed Mar 13, 2013 5:52 pm     Reply with quote

Hello, I just wanted to post a problem that took me a while to figure out so that hopefully it will save the next person some time. I was trying to get the watchdog timer to work on a PIC18F67K22. I set the configuration bits as follows:
#fuses WDT,WDT1024
However, the PIC would never reset. Looking at the configuration bits, the WDT enable bit was cleared despite my clear intention to set it with the #fuse statement. Well, it turns out that the compiler ignores the WDT fuse if you also have this in your code:
#device ICD=TRUE
Remove that and the WDT works fine. I wasn't able to find a reference to this quirk anywhere. The weird thing is that the debugger seems to work fine even with that statement removed, so I don't even know what that does. Regardless, I wish the compiler would issue a warning when it ignores one thing because of another. It would have saved me a lot of time. (I'm such a whiner!).
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Mar 13, 2013 6:07 pm     Reply with quote

Quote:
I wasn't able to find a reference to this quirk anywhere

It's a recurring issue on the forum, in fact just yesterday it was discussed:
http://www.ccsinfo.com/forum/viewtopic.php?t=50053


Quote:
I wish the compiler would issue a warning

If you have current maintenance for the compiler, email CCS support
and ask that they issue a warning when any #fuses settings are changed
due to the DEBUG fuse being active, or #device ICD=TRUE being present.
If enough people request this, they might do it.
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