> Yeah, I know, I've been trying to prove it to myself as well > I have the following code in my initialise routine now: > msg = "Unknown"; > //What caused the reset? > if(!POR == 0){ > if(!TO == 0) > msg = "Illegal"; > else if(!PD == 0){ > msg = "Illegal"; > }else{ > msg = "Power On"; > } > }else{ > ..... Hello Josh, The logic here seems to be wrong. When the PIC power on for the first time, it's true that /POR bit will be cleared. But you have to set it immediately (inside the true branch of if). If the next reset is due to other cause than POR, then PIC will see /POR set, which will tell that the last reset is not POR but any other reset. If you didn't do that, for all kind of reset, the code execution will enter the true branch because the PIC won't set /POR bit for you. Inside that branch, you might need to set/clear other reset flags, depend on whether you want to monitor that particular reset. On top of my head, I can't remember all those things and you have to refer to the data sheet. Another thing is that I haven't worked with the reset detection logic of F88 but have been working for other processor. I am not sure if the logic will be the same across different processor. Hope this helps. Best regards, -- WH Tan -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist