Searching \ for '[PIC]: keeping watchdog a bay during sleep on 12c5' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'keeping watchdog a bay during sleep on 12c5'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: keeping watchdog a bay during sleep on 12c5'
2001\06\07@140432 by jamesnewton

face picon face
I've never run into this combination before so I thought I would forward
this to the list for Soni...

...I would assume the thing to do is disable the WDT before you SLEEP and
then re-enable it on wake up, but I've never had cause to use SLEEP so I
don't really know.

---
James Newton (PICList Admin #3)
spam_OUTjamesnewtonTakeThisOuTspampiclist.com 1-619-652-0593
PIC/PICList FAQ: http://www.piclist.com or .org

{Original Message removed}

2001\06\07@143127 by Spehro Pefhany

picon face
At 10:58 AM 6/7/01 -0700, you wrote:
>I've never run into this combination before so I thought I would forward
>this to the list for Soni...
>
>...I would assume the thing to do is disable the WDT before you SLEEP and
>then re-enable it on wake up, but I've never had cause to use SLEEP so I
>don't really know.

You can't turn the WDT off (this is actually a valuable feature), it's
controlled by a configuration bit. Otherwise noise etc. could turn the
WDT off accidentally.

I think I'd leave the WDT operating, and deal with the momentary wake-ups
by using the STATUS register to distinguish between WDT resets and the other
kind. If that negatively impacts battery life etc. too much, then I'd look
at never turning it on, or using an external WDT.

Bset regards,
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
.....speffKILLspamspam@spam@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\06\07@144115 by Graham Harrison

flavicon
picon face
But the WDT can only be enabled or disabled by the config setting, which is
not alterable at run-time.

----- Original Message -----
From: James Newtons' MassMind <jamesnewtonspamKILLspamMASSMIND.ORG>
To: <.....PICLISTKILLspamspam.....MITVMA.MIT.EDU>
Sent: Thursday, June 07, 2001 6:58 PM
Subject: [PIC]: keeping watchdog a bay during sleep on 12c509A


{Quote hidden}

> {Original Message removed}

2001\06\08@063946 by mike

flavicon
face
On Thu, 7 Jun 2001 14:32:38 -0400, you wrote:

>At 10:58 AM 6/7/01 -0700, you wrote:
>>I've never run into this combination before so I thought I would forward
>>this to the list for Soni...
>>
>>...I would assume the thing to do is disable the WDT before you SLEEP and
>>then re-enable it on wake up, but I've never had cause to use SLEEP so I
>>don't really know.
>
>You can't turn the WDT off (this is actually a valuable feature), it's
>controlled by a configuration bit. Otherwise noise etc. could turn the
>WDT off accidentally.
>
>I think I'd leave the WDT operating, and deal with the momentary wake-ups
>by using the STATUS register to distinguish between WDT resets and the other
>kind. If that negatively impacts battery life etc. too much, then I'd look
>at never turning it on, or using an external WDT.
Of course you CAN change the prescaler, so you don't wake up very
often. Doing this makes avarage power draw little more than the extra
the WDT itself takes. Remember to do a CLRWDT before changing the prescaler to a slower
setting though - failing to do this can cause spurious resets.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\06\08@140637 by Olin Lathrop

face picon face
> ...I would assume the thing to do is disable the WDT before you SLEEP and
> then re-enable it on wake up, but I've never had cause to use SLEEP so I
> don't really know.

The watchdog is enabled/disabled in the configuration fuses.  It can't be
disabled or enabled at run time.  Allowing it to be disabled at run time
would defeat part of its intended purpose.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, olinspamspam_OUTembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\06\08@170335 by jamesnewton

face picon face
erk... I knew that, I was just testing you.

Duh! If the processor went nuts, it could easily disable the WDT, which
would make it useless. Of course, there is nothing that prevents a whacked
out processor from getting stuck in a loop where the WDT is constantly being
reset either, but I suppose that would be a lot less likely.

---
James Newton (PICList Admin #3)
@spam@jamesnewtonKILLspamspampiclist.com 1-619-652-0593
PIC/PICList FAQ: http://www.piclist.com or .org

{Original Message removed}

2001\06\08@172355 by Spehro Pefhany

picon face
At 02:02 PM 6/8/01 -0700, you wrote:
>erk... I knew that, I was just testing you.

Good save.

>Duh! If the processor went nuts, it could easily disable the WDT, which
>would make it useless. Of course, there is nothing that prevents a whacked
>out processor from getting stuck in a loop where the WDT is constantly being
>reset either, but I suppose that would be a lot less likely.

Yup, and as the programmer you can *make* it less likely by not doing
silly things like resetting the WDT in a timer interrupt routine, by doing
some basic checking to see if things "seem" to be ok, before resetting, that
sort of thing. Even if the WDT requires resetting at a higher rate than
the most complex operations in your program, you can have a countdown
timer that inhibits the WDT reset if, say, an important result is not
delivered every few seconds.

The PIC has a circular buffer for the hardware stack, so this
isn't a consideration for PICs, but on some processors I write a "canary"
byte past the end of where the stack should end (in RAM). If the stack
grows too far for some reason, it over-writes the byte (which is only set
at power-up) and the WDT eventually resets everything.

Best regards,

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
KILLspamspeffKILLspamspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\06\08@183844 by Bill Westfield

face picon face
I think it's the Atmel parts (and perhaps other) where software can turn
on the watchdog timer, but not turn it off.  So you turn it on in
initialization (if you want) and then have to reset it periodically,
but bogus code can't cause it to be turned off accidentally...

BillW

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\06\08@184603 by Dan Larson

flavicon
face
On Fri, 8 Jun 2001 15:37:31 PDT, William Chops Westfield wrote:

>I think it's the Atmel parts (and perhaps other) where software can turn
>on the watchdog timer, but not turn it off.  So you turn it on in
>initialization (if you want) and then have to reset it periodically,
>but bogus code can't cause it to be turned off accidentally...

Not *quite* accurate... to quote the data sheet:

 Bit 3 - WDE: Watchdog Enable
When the WDE is set (one) the Watchdog Timer is enabled, and if the WDE is cleared (zero) the Watchdog Timer function
is disabled. WDE can only be cleared if the WDTOE bit is set (one). To disable an enabled Watchdog Timer, the following
procedure must be followed:
1. In the same operation, write a logical "1" to WDTOE and WDE. A logical "1" must be written to WDE even though it
is set to one before the disable operation starts.
2. Within the next four clock cycles, write a logical "0" to WDE. This disables the Watchdog.

>
>BillW
>
>--
>http://www.piclist.com hint: The PICList is archived three different
>ways.  See http://www.piclist.com/#archives for details.
>
>
>

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\06\09@040955 by Peter L. Peres

picon face
> set wdt period long before sleeping

I routinely reach 11 uA sleep current at 5V and 25 degrees C using 12C508A
with sleep on and long watchdog set (option LSB bits 111). No problems.
I've yet to see another micro in this price range that can do that and
still wake up by itself (w/o external interrupts).

Peter

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...