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

Cant i turn WDT on/off as i like?

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







Cant i turn WDT on/off as i like?
PostPosted: Mon Jun 06, 2005 9:07 am     Reply with quote

I am using a PIC16LF76 and i found out that i can only setup and restart the WDT. The enable/disable option is only valid for PIC18. What can i do?

I tried to manually clear WDTE of Config Reg addr:2007 but to no avail. The WDT still carries on...

My project uses sleep to put the PIC in standy mode so it will not waste energy but if i keep on forcing it back to sleep after it wakes by WDT, is not meeting my objective of doing so.. Pls help.

Thanks Crying or Very sad
valemike
Guest







PostPosted: Mon Jun 06, 2005 9:41 am     Reply with quote

The way i understand most of the PICs, the watchdog timer enable/disable is a setting in the FUSE bits, that get programmed in when you flash the chip.

The only control you have over the wdt now once the PIC is running is to refresh it and, i think, to change its timeout rate.

So if you must use the wdt and go to sleep, then the best you can do then is to set the WDT for the maximum time til timeout, which i think is 2+ seconds. This time varies with temperature and per device though.
valemike
Guest







PostPosted: Mon Jun 06, 2005 9:45 am     Reply with quote

By the way, even if the PIC does wake up every few seconds or so because of the WDT, all you have to do is to quickly go back to sleep. If you put an ammeter thru it, this isn't as bad as you think. You'll only draw a spurt of a few microvolts (or a few millivolts). Such activity alone ought to last longer than the battery's shelf life itself.
jo
Guest







Thanks
PostPosted: Mon Jun 06, 2005 9:50 am     Reply with quote

ya, i think thats the only way out.. thanks for your info..

but what about the WDTE,bit2 in Config Reg 2007? it says WDT can be disabled by clearing it?
sorry for all the ques, i am still very new in all this..
MikeValencia



Joined: 04 Aug 2004
Posts: 238
Location: Chicago

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Mon Jun 06, 2005 2:47 pm     Reply with quote

"Configuration bits" are what i meant by the "fuse" bits, which can only be programmed while you flash the chip.
Steve H
Guest







PostPosted: Mon Jun 06, 2005 3:38 pm     Reply with quote

The WDT is like a fail safe for your program. If misbehaving software could turn it off it would not be a very reliable fail safe. That's why it can't be disabled via software.

Steve H.
jo
Guest







Got it!
PostPosted: Tue Jun 07, 2005 6:29 am     Reply with quote

ok, i understand now.. thanks for all the help..

that explain why nothing hapen even if the WDTE bit is changed during execution ..

thanks again Very Happy
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Thu Jun 09, 2005 1:46 pm     Reply with quote

There are other PIC's that do allow you to enable or disable the WDT through software. I use an 18F452 quite regularly and if left disabled, at programming time, it can be controlled via software. If you need control of the WDT then look for another PIC that will allow you to do this.

Ronald
jo
Guest







thanks
PostPosted: Fri Jun 10, 2005 4:17 am     Reply with quote

ok, thanks for the info.. however i am stuck with the PIC16 at the moment. Anyway i have implemented the WDT and is waking up every 2 sec to go back to sleep again...

Very Happy
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