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

How to setup WDT during sleep to prevent a device reset?

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



Joined: 28 Aug 2007
Posts: 106

View user's profile Send private message

How to setup WDT during sleep to prevent a device reset?
PostPosted: Sat Jun 28, 2008 4:31 am     Reply with quote

Hi all,
I´m using a PIC12F675 and Compiler version 4.018

In the datasheet I can read that the WDT is running during sleep and resets the device when the WDT has a time out... also I can´t find how to turn off the watchdog before I use the sleep() instruction. I know from the 18F Pics that in CCS is a WDT_OFF function, but I can´t find it for the 12F types.

I only found this:
The CLRWDT and SLEEP instructions clear the WDT
and the prescaler, if assigned to the WDT, and prevent
it from timing out and generating a device RESET.

I understand... but when in sleep-mode I can´t execute a CLRWDT instruction... or am I wrong?

And I found this:
The WDT can be permanently disabled by
programming the configuration bit WDTE as clear
(Section 9.1).

But this is not possible during the program is running?

Any Ideas how to go in sleep mode and reseting the WDT or how to turn it off?

Thanks
Richard
Guest








Re: How to setup WDT during sleep to prevent a device reset?
PostPosted: Sat Jun 28, 2008 5:34 am     Reply with quote

The WDT on the 12F675 can only be enabled or disabled during the initial programming of the fuses. It cannot be affected by your code. The only thing your code can do is periodically clear the WDT. If your program goes to sleep with the WDT enabled, it will wake up when the WDT expires. If this a problem for you, then either

1. Don't enabled the WDT with the configuration fuses or
2. Upon waking up, go right back to sleep again.

Robert Scott
Real-Time Specialties
Futterama



Joined: 17 Oct 2005
Posts: 98

View user's profile Send private message

PostPosted: Sat Aug 23, 2008 4:24 pm     Reply with quote

The PIC12F683 have the ability to enable or disable the WDT from software using bit SWDTEN. The WDT must be disabled in the fuses to use this feature.
nandoogle



Joined: 20 May 2012
Posts: 1
Location: Ribeirao Preto, Sao Paulo, Brazil

View user's profile Send private message Send e-mail MSN Messenger ICQ Number

Tanks Futterama
PostPosted: Sun May 20, 2012 6:13 pm     Reply with quote

Futterama wrote:
The PIC12F683 have the ability to enable or disable the WDT from software using bit SWDTEN. The WDT must be disabled in the fuses to use this feature.



I was exhausted looking for a solution to the WDT problem, but you helped me with the PIC12F683.

Tnks again
_________________
Nothing for now
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