piclist-bounces@mit.edu wrote: > TO should be "1" after power-up, CLRWDT or Sleep. yes. But it should also be '0' after WDT. At least according to the datasheet. Hence my confusion. > TO is a poor indicator since you do not know if it was a sleep or > reset that triggered it. Therefore leave TO out of your program. makes sense, since according to the datasheet TO will always be zero after WDT. I must still be misunderstanding something. The way I read the tables (10-6, 10-4, and also the STATUS register), TO should always be zero after WDT, whether the PIC was sleeping or not. But the simulator shows TO to be '1' So what is it supposed to be? Is the simulator wrong or the datasheet? Or is it my interpretation? > If you let your program run-away, then the WDT is going to reset your > micro and PD would be 1. If your micro was powered-up, then PD is 1. > If you performed a Sleep, then PD is 0. > > Since you are doing a sleep, then use PD to differentiate between a > reset-power-up and a sleep-power-up. makes sense, also. my startup code does check that, along with the BOD and POR bits. Thanks for the input. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist