Searching \ for '[PIC] Basic WDT Questions' 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/languages.htm?key=basic
Search entire site for: 'Basic WDT Questions'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Basic WDT Questions'
2004\10\04@093644 by Roberts II, Charles K.

picon face
Hello list

I am adding a Watch Dog Timer to my software on a PIC16F873A. I have
never used the WDT before so I have a few basic questions.

In the Option Register when you set the prescaler to the various
settings; i.e 1:1, 1:128, ...etc; is does that mean the WDT reset 1 per
clock cycle and once per 128 clock cycles?

Can you set the PSA bit to Timer0 to get a higher WDT rate? The Data
sheet mentions using the PSA to WDT to get a 1:1 rate for Timer0, does
it work both ways.

Thanks in advance for your help.


Chuck


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@103806 by Shawn Tan Ser Ngiap

flavicon
face
part 1 1764 bytes content-type:multipart/signed; (decoded 7bit)

--nextPart5107370.8mYNS0v7Rm
Content-Type: text/plain;
 charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

The WDT resets the processor when it overflows... the pre-scalar is used to=
=20
change the rate at which the WDT will overflow.. if you use a 1:128, means=
=20
that the WDT will increment by one for every 128 click ticks.. It will only=
=20
reset after overflow.. according to the PIC data sheets, a single overflow =
is=20
about 18ms.. so, 1:128 will be 18ms * 128..

Hope this helps..

On Monday 04 October 2004 21:36, Roberts II, Charles K. wrote:
{Quote hidden}

=2D-=20
with metta,
Shawn Tan


--nextPart5107370.8mYNS0v7Rm
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQBBYWCgUgUYbQRKphMRAv4lAKC471hTnQbMygNFAGvPtRRXVliRIwCgr6XM
IMjfjDzm+Zctgd87NMUL1yU=
=Gyg8
-----END PGP SIGNATURE-----

--nextPart5107370.8mYNS0v7Rm--


part 2 194 bytes content-type:text/plain; charset="us-ascii"
(decoded 7bit)

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@115947 by Roberts II, Charles K.

picon face


>The WDT resets the processor when it overflows... the pre-scalar is
used to
>change the rate at which the WDT will overflow.. if you use a 1:128,
means
>that the WDT will increment by one for every 128 click ticks.. It will
only
>reset after overflow.. according to the PIC data sheets, a single
overflow >is
>about 18ms.. so, 1:128 will be 18ms * 128..

>Hope this helps..

>--
>with metta,
>Shawn Tan


So how big is the WDT register? And how fast is the WDT RC Oscillator?

Is the Oscillator 1/18ms? So does that mean that after 128 WDT Clock
cycles the WDT increments by one?

Or does the WDT reset after 128 WDT clock cycles?

Thanks for your help but I am still a little confused.

Chuck  

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@122415 by Jan-Erik Soderholm

face picon face
Roberts II, Charles K. wrote :

> So how big is the WDT register? And how fast is the WDT RC Oscillator?

None of those are interesting realy...

The basic WDT timeout is 18 ms.
Can be prolonged using the post-scaler.
That's all.


> Is the Oscillator 1/18ms? So does that mean that after 128 WDT Clock
> cycles the WDT increments by one?

The WDT realy never "increments" (well internaly maybe), it just times out.

Check the data sheet for the details.
/Jan-Erik.
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@134704 by Eisermann, Phil [Ridg/CO]

flavicon
face
piclist-bounces@mit.edu wrote:
> So how big is the WDT register?

You're thinking about it in the wrong way, see below.

> And how fast is the WDT RC Oscillator?

Parameter 31 says the WDT times out in 7msec to 33msec,
with an average of 18msec. When that happens, the
PIC "resets" I put it in quotes to differentiate the
WDT event. Use the PCON register to figure out which.

>
> Is the Oscillator 1/18ms? So does that mean that after 128 WDT Clock
> cycles the WDT increments by one?
>
> Or does the WDT reset after 128 WDT clock cycles?
>

Maybe the following will help you get your head around it:
You have a RC oscillator that "times out" somewhere between
7 and 33 msec. use 18msec average if that helps, but be aware
that it can be much less in practice.

If you do not reset the WDT within that time, your PIC will
restart. Thats the WDT reset.

Now, you have a prescalar. You can assign the prescalar to either
WDT or TMR0, but not both. The prescalar extends the time before
the WDT event occurs. If you set the prescalar to 128, that means
the WDT times out between 896msec (7*128) and 4224msec (33*128)

So it doesn't really matter how big the WDT counter is, or if
it even has a counter. Just think of it as a "black box" that
causes the PIC to reset after some amount of time. See Fig 5-1
This "WDT reset" signal can be fed into the prescalar, meaning
you need several WDT reset signals before it actually resets.

Does that interpretation help any?

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@143458 by Roberts II, Charles K.

picon face


>-----Original Message-----
>From: spam_OUTpiclist-bouncesTakeThisOuTspammit.edu [.....piclist-bouncesKILLspamspam@spam@mit.edu] On
Behalf Of >Eisermann, Phil [Ridg/CO]
{Quote hidden}

Now I understand. I was thinking too deep into how the WDT works, Thanks
to everyone on the list for the help.

Chuck


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\16@175846 by Jinx

face picon face
Only just got around to some old mail

> The basic WDT timeout is 18 ms.
> Can be prolonged using the post-scaler.
> That's all

WDT hasn't been mentioned for a while so thought this
was worth pointing out for those new to the list -

WDT is affected by temperature as well as the pre-scaler. This
can work for or against you, depending on the circumstances.
No good for accurate timing, but great if you're using the PIC as
a thermometer (eg WDT vs stable crystal)

These measurements were made using four commercial-grade
16F84 from different batches. Reference points were -15, 20
and 82 degC. AFAIK WDT still responds to temperature the
same way on the latest PICs

One stopped at 85degC, and resumed on cooling. p/s is set to
maximum of 1:128 => nominal time-out of 2.3 seconds. Minor
deviations from straight-line can probably be put down to my
measurement technique

degC  Time   % of expected

82  2.9716  100.00      80  2.9573   99.99
78  2.9332   99.96      76  2.9050  100.08
74  2.8769  100.19      72  2.8489  100.31
70  2.8201  100.45      68  2.8081   99.99
66  2.7818  100.05      64  2.7624   99.86
62  2.7382   99.84      60  2.7210   99.56
58  2.6830  100.04      56  2.6635   99.84
54  2.6436   99.65      52  2.6232   99.48
50  2.5922   99.71      48  2.5618   99.93
46  2.5346   99.98      44  2.5103  100.12
42  2.4942   99.65      40  2.4675   99.72
38  2.4395   99.85      36  2.4136   99.89
34  2.3882   99.70      32  2.3522  100.39
30  2.3324  100.18      28  2.3029  100.38
26  2.2767  100.45      24  2.2562  100.26
22  2.2356  100.08      20  2.2125  100.00
18  2.1902   99.89      16  2.1592  100.17
14  2.1432  100.24      12  2.1133  100.00
10  2.0846   99.82       5  2.0311  100.77
0  1.9601   99.86      -3  1.9284  100.04
-7  1.8809  100.12     -10  1.8581  100.34
-13 1.8067  100.13     -15  1.7782  100.00



_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

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