Searching \ for 'WDT' 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/index.htm?key=wdt
Search entire site for: 'WDT'.

Truncated match.
PICList Thread
'WDT'
1999\11\29@015813 by ckchan

flavicon
face
Greetings,

i'm new to this list (in fact this is my first post :)

well, i have some questions about WDT. i need some understanding about
it.

1) what will WDT do ? is it the WDT will interrupt at every preset time
to check if the program hang ?

2) if the prescaler is set to 1:128 for WDT, will this mean the WDT will
interrupt every 6.5536 ms (20Mhz crystal) ? if so, is it possible to
have longer period ?

TIA :)

regards,
ckchan

1999\11\29@083144 by Steve Landas

picon face
A WDT will cause a reset if it is not triggered before it times out. The idea
is for the WDT never to time out. So you scatter a routine throughout your
code to ensure it is triggered before it can time out.

1999\11\29@162529 by paulb

flavicon
face
Steve Landas wrote:

> The idea is for the WDT never to time out.  So you scatter a routine
> throughout your code to ensure it is triggered before it can time out.

 Err, no!  That is not what you do.  If you want to do that, it is much
easier to set WDT_OFF in the configuration word, *then* it will never
time out.

 Correct use of the WDT is a FAQ and slightly involved.  Basically, you
decide on a part of the code which is always executed if the program is
working correctly, at intervals less than the time-out period set up for
the WDT.

 You then place *one* CLRWDT instruction in this code so that if the
code fails to execute this instruction because it incorrectly branches
somewhere else and gets caught in a loop or something, then the WDT
times out and causes a processor reset.

 This to protect against a glitch causing code execution to go awry.
It is not intended to counteract a program error.  In practice however,
it is often not needed for the protective purpose and used instead as an
extra, approximate timer function, particularly to allow current saving
in periods of sleep.

 Sorry, I didn't check the original poster's calculations for the
timeout period but it is essentially *approximately* 18 ms times the
prescaler value set up for the WDT, *IF* it is assigned to the WDT.  If
the prescaler is assigned to the counter, then timeout is 18 ms.
--
 Cheers,
       Paul B.

1999\11\29@172845 by Tony Nixon

flavicon
picon face
ckchan wrote:
>
> 2) if the prescaler is set to 1:128 for WDT, will this mean the WDT will
> interrupt every 6.5536 ms (20Mhz crystal) ? if so, is it possible to
> have longer period ?

The WDT has it's own internal oscillator and therefore is independant of
the clock used for the chip itself, however, the WDT clock rate will
vary with changes in temp.

You can use the postcaler to get WDT timeouts of around 2 seconds when
set to 1:128. At 1:1 it is about 18mS.


--
Best regards

Tony

http://www.picnpoke.com
Email spam_OUTsalesTakeThisOuTspampicnpoke.com

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