At 12:04 PM 7/05/97 +0000, Ruben Jšnsson wrote: >Hello all. > >I have a problem with the Watch Dog Timer (or the *TO bit in the >status register) in a 16C57. > >When the program is reset by a power up or a WDT timeout it does a >selftest of all used instructions, the RTCC and the WDT. > >The WDT timer is tested as follows: > >The first time at power up (*TO=1) the selftest routine checks all >instructions, the RTCC and writes 0x12345678 into 4 ram registers. It >then does an endless loop broken only by the WDT, which in turn calls >the selftest routine again. This detects that it is a WDT timeout and >checks if the 4 ram registers contain 0x12345678. If they do it knows >that this was an intentional WDT timeout and resets the registers >again (so an unintentional WDT is detected) and returns. If there is >any faults detected or it was an unintentional WDT timout it goes >into and endless loop and indicates this on a LED output. > >This all works fine - mostly! The problem is if I turn the power off >and on again quickly (VDD goes down to about 2V), then sometimes the >*TO bit is cleared at power up so the selftest routine thinks that it >was a WDT timeout and goes into the error loop because the 4 ram >registers are not 0x12345678. > >I use a Dallas DS1233, 5V reset circuit which gives a nice and clean >300 ms reset pulse on MCLR at power up but this doesn't seem to >help. The *TO bit is sometimes cleared anyway. > >I don't know how to deal with this problem, I can't just clear the >WDT at reset because then I can't test it. Is there anybody else that >has had similar problems and perhaps even solved them? > >Regards >------------------------------------ >Ruben Joensson >AB Liros Elektronik >Box 9124 >200 39 Malmoe >Sweden >Tel +46 40 14 20 80 >Mail: ruben@sbbs.se >------------------------------------ > > 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. I rewrote code, setting all registers during initialization, but the problem is still there. I am hoping that the A versions of the chip with brown out protection fix this problem, but in the mean time I have built an extra circuit which shorts the VDD to GND, and this seems to have gotten around the problem, but it is a messy solution. I have also changed to an LDO that requires only 3.3uF on the output. I know of another user who has experienced very similar problems, and he too has had to get around the problem by ensuring VDD goes to ground. Does any one know if this problem is fixed by the BROWN OUT on the A chips? Hope this little bit helps regards Gordon Slater gordons@cobweb.com.au