PDA

View Full Version : watchdog timer



amindzo
- 27th May 2011, 08:57
Hi, in my program i have some loops that the program should stock in these loops until something happens, sometimes we have some errors from sensors and the program stock in these loops for a long time. can i use the watchdog timer to reset the program after a certain time? i use picbasic pro and pic16f873a.

aratti
- 27th May 2011, 13:55
You can easily incorporate a timeout function within the routine reading the failing sensors. Once the timeout has elapsed you can direct the flow of your program at the most convenient point for resume the errors.

The timeout is just a word variable used as a counter. You will clear it, all the time you enter the routine, and once in the loop, the variable increments till reach the timeout value you will set.

Cheers

Al.