Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to use a Watch Dog Timer?

Status
Not open for further replies.

hameeds01

Advanced Member level 2
Joined
Aug 23, 2005
Messages
599
Helped
75
Reputation
156
Reaction score
41
Trophy points
1,308
Location
Islamabad Pakistan
Activity points
4,540
How to use a Watch Dog Timer? Am I using the WDT in a correct way?? I need a sample code for wdt in CCS C ……
Its not working only it performs task2 :|

#include <16F877A.h>
#fuses XT,WDT,PUT,BROWNOUT,NOPROTECT,NOLVP,NOCPD
#use delay(clock=4000000, RESTART_WDT)

timer0_ISR
{
restart_wdt()
task1()
}

main()
{
setup_wdt(WDT_18MS)
while(true)
{
restart_wdt()
task2()
}
}
 

Re: WDT help???

You'll never reset a wdt in an isr as it's possible that the program hangs while the timer interrupt is still running.
Reset the wdt at different locations in your application.
 

Re: WDT help???

Whatz the relationship b/w timer0 &wdt? If I enable wdt then timer0 runs very fast but it runs fine when I disable wdt ????
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top