What the bit values are after POR or MCLR reset are detailed clearly in the datasheet. Sometimes within a register only a single bit remains unchange. For others a single bit changes while the bits stay the same.
You need to refer to the datasheet on sections "Special register Summary" and "INITIALIZATION CONDITION FOR SPECIAL REGISTERS".
There is no special GP register, only General Purpose register.
You are on your own to set or clear them. The PIC won't do it for you. The values they contain can be anything upon power ON and relying on them to be a fixed value(zero) without initialising is plain stupid. These registers will hold their values when power is healthy.
If you simply want to know if a power on occurred or reset was pressed then there are bits in the Status register for that purpose. A simple way to know is to check bit 3 of status, if it's set then it was a power on reset and you need to clear it, if it's clear then you pressed the reset button. Note, if you don't clear it after you check it then it will stay set after you press reset.
If you simply want to know if a power on occurred or reset was pressed then there are bits in the Status register for that purpose. A simple way to know is to check bit 3 of status, if it's set then it was a power on reset and you need to clear it, if it's clear then you pressed the reset button. Note, if you don't clear it after you check it then it will stay set after you press reset.
This is my attempt I'm trying to detect whether a MCLR reset has occurred or power on reset has occurred.Earlier I did that with a GP register.But there is a dedicated bit for that purpose.
If you simply want to know if a power on occurred or reset was pressed then there are bits in the Status register for that purpose. A simple way to know is to check bit 3 of status...
Mike.
I stated a simple way to know one from the other. As the OP is a beginner testing bit 3 of STATUS will suffice. Adding complications like PCON is just likely to confuse.