Page 1 of 1

How can I use the watchdog

Posted: Mon Sep 29, 2008 8:14 pm
by P_T
I would like the Watchdog to use the 16F877A.
My preference is for a software version .
Has someone an example or a link.

Re: How can I use the watchdog

Posted: Tue Sep 30, 2008 10:35 am
by Benj
Hello

Basically all you have to do to use the watchdog is the following.

1) Enable the watchdog using the Chip -> Configure screen.

2) In your main program loop add the following line into a C code icon: clr_wdt();

3) Any further modification eg the watchdog timeout and prescaler etc can be found in the device datasheet and modified by using C code to control the option_reg prescaler register.

eg: option_reg = 0x00;