> Date: Fri, 9 May 1997 10:09:47 -1700 (GMT) > To: ruben@sbbs.se > From: gordon slater > Subject: WDT problem --- SNIP --- > I have experienced a very similar problem with the PI16C74-JW parts. > > The problem as best as I can determine occurs if the supply voltage does not > disappear totally before a restart. > > The application that exhibited this problem is one in which the PIC is > switched on for short periods, generally no more than 30 secs, and can be > off from 1 sec to days, so put a DS1233 on the MCLR fo safety, to be sure > that there is always a good reset condition, unfortuately that did not > resolve the problem. > > I am using a LDO(Low Dropout Regulator) which requires a large capacitor > (47uF) on the output, and this holds the supply to the chip at less than a > volt for a long while after power has been removed. If power is reapplied > while there is still some voltage present on the VDD to the chip, the PIC > will sometimes not start properly - even though the MCLR pin is held low > while power is being applied and held low for 300ms. The situation the PIC > seems to get into is that the watchdog does not get reset by CLRWDT, and so > the processor continuously gets itself reset by the watchdog - this > situation continues even if MCLR is shorted to ground (by a jumper) in an > attempt to reset the PIC. The situation clears itself if VDD is shorted to > ground and it will then restart correctly. > > To rephrase something said above in case of confusion - the pic does restart > properly, but it is solely the watchdog which cannot be reset, and hence > restarts the pic continuously ad infintum, until VDD is zeroed. ---SNIP--- Hello Gordon and thanks for your reply. After a bit of further investigation (experimentation) I have found out the following: What happens when I switch the power of and on again before it has gone completely to zero is that the DS1233 resets the PIC which stops to work but somehow the WDT also times out and sets the *TO bit. When power is switched on again the PIC continues to run after the 300 ms MCLR reset. Since the VDD has been high enough for the PIC to continue to work, it has seen this as a MCLR reset with power still on. Since a MCLR reset dosn't change the *TO bit the program thinks it has been a WDT timeout. I have solved my problem by not using the *TO bit to check if the reset came from a WDT (since I can't rely on it) and instead using a signature in RAM which is set to a certain value when I have tested the WDT at power up the first time. This signature is then not changed by the short interruption of the power. ------------------------------------ Ruben Joensson AB Liros Elektronik Box 9124 200 39 Malmoe Sweden Tel +46 40 14 20 80 Mail: ruben@sbbs.se ------------------------------------