Electronic – microchip pic18f: What is the difference between a POR/BOR and other resets

reset

I found similar questions on the internet. some answered that all resets re-initialize the SFR. I don't know if this was tested or concluded. I'm so confused because at http://microchip.wikidot.com/8bit:mclr they state that:

When an external MCLR reset occurs, the program counter will be reset to the top of the program execution or memory location 0x00 which is the start of all program memory. MCLR resets will not re-initialize all internal functions like a Power On Reset (POR) or Brown-Out Reset (BOR) style reset. It can be considered a hardware means to activate a software reset.

Also in microchip slides (RESET causes and effects) http://ww1.microchip.com/downloads/en/DeviceDoc/reset.pdf

An MCLR reset will not change the state of any general purpose RAM locations, but some of the special function registers will be initialized. This applies to most types of reset, and the initialized state of the special function registers are specified in the applicable data sheet.

In the datasheet, (pic18f45k22) the legend found under the description of the SFR states that the initialization values are after a POR. look for example at TRISA register.

-n = Value at POR

Why did they state that it's "Value at POR" not "Value at any Reset"
on the other hand, some registers such as the OSCCON2 define 2 initialization states.

-n/n = Value at POR and BOR/Value at all other Resets

also in the same datasheet section 4.7 Reset state of registers:

Some registers are unaffected by a Reset. Their status is unknown on POR and unchanged by all other Resets. All other registers are forced to a “Reset state” depending on the type of Reset that occurred.

What does that mean!?

also in the same dataheet:

Table 5-2 describes the Reset states for all of the Special Function Registers. The table identifies differences between Power-On Reset (POR)/Brown-Out Reset (BOR) and all other Resets, (i.e., Master Clear, WDT Resets, STKFUL, STKUNF, etc.). Additionally, the table identifies register bits that are changed when the device receives a wake-up from WDT or other interrupts.

Well, table 5-2 has only the "values at POR/BOR". How can I know the value at other resets!?
I find this confusing. So are all SFR initialized to the values in the table after any reset… For example, will an MCLR reset cause the TRISA register to initialize to 0xFF or will it remain unchanged?

Thanks a lot

Best Answer

The information is there, but the datasheet does a poor job of explaining it. For example, TRISA has this:-

enter image description here Above each bit name the -1 (described as -n in the legend) means that bit will be a 1 at power on. No separate values are shown for other resets - so we must assume that they are the same...

Looking at LATA we have this:-

enter image description here

The -x/u means indeterminate ('x') at power on, and unchanged ('u') on other resets. But the legend is deficient because it doesn't tell us what 'u' means.

Table 5-2 only shows the values for Power On and Brown Out Reset, so clearly the statement that it "identifies differences between POR/BOR and all other Resets..." is wrong. Also RCON and STKPTR values are not the same for both POR and BOR.

Datasheets for older PICs have clearer descriptions of the reset conditions. For example, here is PORTA on the 18F452:-

enter image description here