Starfire Zhu wrote: > My problem is about the identification of RESET STATUS of PICs at work. > If the PIC(e.g. P16c54) has disabled the WDT and doesn't use SLEEP on > whole process, after RESET on MCLR, how could I reliably determine > whether this RESET is caused by POWER-ON or MCLR? In other words, > is there any FLAG BIT that can change its value in different RESETs? I get the PICLIST in digest form and I kind of waited to see if anyone else might answer you but since I can't find a reply, here is my two pence. An idea that occurs to me (someone please correct me if I'm wrong) is to write value(s) from the EPROM into RAM variable(s). On a MCLR reset, the values should be unchanged. On a power-up, the RAM locations come up with random contents. Your initialization code can check for the correct values. If they are not present then you know that this is a power-up so you write the values into the RAM locations. Of course, if they are there, then you know you are resetting from a /MCLR. If you use one 8-bit variable, then the chances are 255 to 1 that power-up would produce the same value; two variables = 65535 to 1, etc. I have never tried it, but it makes sense. Michael REMOVE THE .NS (NO SPAM) FROM MY ADDRESS TO REPLY ***************************************** The strong do what they have to do and the weak accept what they have to accept. --Thucydides