PDA

View Full Version : Lost in finding a example



F1CHF
- 17th January 2007, 21:56
Hello
I have trouble to search ...
for example, I am sure that I already saw a very good explanation about
WATCHDOG use ... if I make a SEARCH with this argument, I got 131 answers
so I am lost ?
Did I use a bad method to search ?

Could you help me to find this good article which explain HOW to use it
and give an example to test it ..
thanks in advance

Francois

Darrel Taylor
- 17th January 2007, 22:09
It depends on what you want to do with the watchdog timer.

But you might find more results searching for SLEEP or NAP*. Although you'll mostly find tired programmers that need Sleep. :)

They're also in the manual, which is where I'd start.
<br>

BigWumpus
- 18th January 2007, 22:20
...for me it was a long way to understand the WDT-technic.

My 16F876 has a period of maybe 2,5 seconds for the WDT. My controller works in a 0,5-second-loop (derived from Timer1/CCPx), so I put the CLEARWDT at the start of the loop. That was wrong !!!!!

My problem was the I2C-port. So I worked out a sheme to use the I2C-hardware at least 2 times a second. And when then I2C-hardware is working, the interrupt-routine clears the WDT.
So, if the I2C-hardware has a problem, 2,5 seconds later the PIC starts over.

You have to place the CLEARWDT at these points, which are reacting to repeated events. If something is wrong, these events aren't working and the WDT is starting the PIC.

Within the INIT-Part (start) of the programm, you can watch the PCON-bits in order to see the cause of the reset (TO!).

If you are using the default PBP-settings, the CLEARWDT is inserted after each PBP-command and the whole concept isn't work.

Just find out some small pieces of code, which have to be activated repeated and you can build a working WDT.