On Sun, Aug 12, 2001 at 10:40:11AM +0200, Quentin wrote: > You don't have to have WDT on all the time. When you want to do the > reset, you switch it on and let it time out. You don't even use CLRWDT. > When your code restarts, you switch it off in your init routine. My platform is 16F877 and 16C774 (the software should be almost the same for both chips). AFAIK the WDT is enabled by CONFIG word. How can I enable/disable it in software? > > Too many things to clean up. (Additionally the "software reset" should be > > triggered from the interrupt routine). > WDT can be switch on in ISR. Personally, I prefer the GOTO 0 routine, > but that's me. Well, if I could imitate the RESET by "goto 0", I would be glad. But there are a few problems: 1) I need to convert my "interrupt thread" into the "main thread", is setting of GIE, PEIE... enough to achieve it? 2) I should extend my INIT routine so that it sets the initial values in all important registers... -- TIA & Regards, Wojciech M. Zabolotny http://www.ise.pw.edu.pl/~wzab <--> wzab@ise.pw.edu.pl http://www.debian.org Use Linux - an OS without "trojan horses" inside -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.