Well, it is not how to setup the wdt, it is how to implement it. For example I have about 30 functions in my program. If there is a wdt restart I would like to go back to where I was before without effecting the program flow and recover variable values. So the software would continue where it was as if nothing happened. -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Alex Kilpatrick Sent: Friday, July 11, 2003 6:33 PM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: C compiler choice ? >=20 > This remaind me of another problem. How would I implement a=20 > WDT with C? Isn't it a bit difficult maybe impossible or am I=20 > not thinking right? >=20 I'm not sure if I am answering the question you are asking, but here is an example from CCS C docs: main() { setup_wdt(WDT_2304MS); while (TRUE) { restart_wdt(); perform_activity(); } } This sets up the WDT to reset every 2.304 seconds, and you just call restart_wdt() to reset it whenever needed. Alex -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body