How can I use the watchdog

Any general or miscellaneous queries that do not fit into the other forum catagories

Moderators: Benj, Mods

Post Reply
P_T
Posts: 1
Joined: Mon Sep 29, 2008 7:47 pm
Contact:

How can I use the watchdog

Post 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.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: How can I use the watchdog

Post 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;

Post Reply