View previous topic :: View next topic |
Author |
Message |
richi-d
Joined: 28 Aug 2007 Posts: 106
|
How to setup WDT during sleep to prevent a device reset? |
Posted: Sat Jun 28, 2008 4:31 am |
|
|
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? |
Posted: Sat Jun 28, 2008 5:34 am |
|
|
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
|
|
Posted: Sat Aug 23, 2008 4:24 pm |
|
|
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
|
Tanks Futterama |
Posted: Sun May 20, 2012 6:13 pm |
|
|
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 |
|
|
|