17.4.3.3 Using the RCON Status Bits
The user software can read the RCON register after any system Reset to determine the cause of the Reset. The following table provides a summary of the Reset flag bit operation.
Note: Clear the status bits in the RCON register after reading them so that the next RCON register value after a device Reset is meaningful.
Flag Bit | Set By | Cleared By |
---|---|---|
POR (RCON[0]) | POR | User Software |
BOR (RCON[1]) | POR, BOR | User Software |
IDLE (RCON[2]) | WAIT instruction | User Software, POR, BOR |
STANDBY SLEEP (RCON[3]) | WAIT instruction | User Software, POR, BOR |
WDTO (RCON[4]) | WDT timeout and NMI counter expires | User Software, POR, BOR |
DMTO (RCON[5]) | DMT timeout and NMI counter expires | User Software, POR, BOR |
SWR (RCON[6]) | Software Reset Command | User Software, POR, BOR |
EXTR (RCON[7]) | MCLR Reset | User Software, POR, BOR |
CMR (RCON[9]) | Configuration mismatch Reset | User Software, POR, BOR |
BCFGFAIL (RCON[26]) | Non-recoverable error in primary and alternate Configuration Words | User Software, POR, BOR |
BCFGERR (RCON[27]) | Recoverable error in primary Configuration Words | User Software, POR, BOR |