Master Clear Pin External Reset (MCLR)
MCLR: - The Master Clear pin is an optional external reset that is activated by pulling the pin low. The MCLR pin can be setup as an standard digital input pin or be enabled as an external reset pin. This is controlled by a configuration setting.
The MCLR pin, when enabled, will hold the device in reset mode as long as the pin is pulled low. During normal operation, it needs to be pulled high typically through a resistor to Vdd. A small capacitor can be connected from the MCLR pin to ground to hold the device in reset mode longer when pulled low by a short signal. A normally open momentary switch can also be added from MCLR to ground to offer a manual way to reset the device.
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.
Master Clear Enable (MCLR)
The MCLR pin can be enabled or disabled by a bit setting in the configuration register. The MCLR needs to be pulled up to Vdd power to prevent the device from being held in reset mode. This can be done internally by circuitry enabled inside the device or externally by circuitry connected to the device.
If the internal option is selected then the MCLR pin will become a designated digital input pin. The device cannot be reset by an external signal in this mode but it allows for a simpler design. The pin can be left disconnected because internally the MCLR is pulled to a Vdd.
If the external option is selected then the MCLR pin has full control over reset of the device.
This internal or external option is selected by clearing the MCLRE bit (internal) or setting the MCLRE bit (external). The graphic below shows the configuration register that contains the MCLRE bit.