I would like the Watchdog to use the 16F877A.
My preference is for a software version .
Has someone an example or a link.
How can I use the watchdog
- 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
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;
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;
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel