> > Has anyone thought of using the WDT? Just check the flag bits at the > beginning of your program, and you can tell if you're starting from > scratch (better init everything) or just waking up from the WDT. > > You can set the WDT prescaler to the interval you want, then do your > loop stuff, and go to sleep. The WDT will wake you up. You just have > to structure your program to branch to the loop entry from the > beginning if it's a WDT entry... > > That is, if you're not already planning to use the WDT for the obvious... > > Someone give me a sanity check on this... I may use it in an upcoming > project. > > Regards, > > - JohnR > The only problem I see here is that the WDT is a free running on-chip RC oscillator. To quote the DataBook for the PIC16C71: The WDT has a nominal time-out period of 18 ms, (with no prescaler). The time-out periods vary with temperature, VDD and process variations from part to part (see DC specs). So you see, if you want accurate timing, the use of the RTCC is required since it works off of the crystal controlled oscillator. If you put the part to sleep, the crystal oscillator stops and you cannot really get very accurate timing. When I built a recording accelerometer using the 16C71, I used the RTCC with prescaler, checked for zero in the RTCC in a tight loop, On RTCC=0 I sampled, did a little averaging processing, saved the sample to memory via serial routine to EEPROM, then entered my loop. I figured out ahead of time that by the time I finished my routines, the RTCC was no longer at zero so I was not worried about entering the loop and immediately jumping out again. Also, with the prescaler set to at least 4, you will not miss the RTCC=0 point. I chose not to use the RTCC interrupt because I didn't need to do anything else until the time for the next sample rolled around. Your milage may vary of course. Regards, Jerry =============================================================================== Jerry Ethridge Richardson, Tx. | ERICSSON NETWORK SYSTEMS /O\ exujet@exu.ericsson.se \_______[|(.)|]_______/ o ++ O ++ o ===============================================================================