3.12 Reset! Black-out, brown-out OR noises?
Reset condition causes the microcontroller to immediately stop operation and clear its registers. Areset signal may be generated externally at any moment (low logic level on the MCLR pin). If needed, it can also be generated by internal control logic. Power-on always causes reset. Since there are many transitional events taking place when power supply is turned on (switch contact flashing and sparkling, slow voltage rise, gradual clock frequency stabilization etc.), it is necessary to provide a certain time delay for the microcontroller before it starts to operate. Two internal timers- PWRT and OST are in charge of that. The first one can be enabled or disabled during the process of writing a program. Let’s take a look what happens then:

When the power supply voltage reaches 1.2 - 1.7V, a circuit called
Power-up timer resets the microcontroller within approximately 72mS. As soon as this time expires, another timer called
Oscillator start-up timer generates another reset signal within 1024 quartz oscillator periods. When this delay expires (marked as T
reset in figure) and the MCLR pin is set high, all conditions are met and the microcontroller starts to execute the first instruction in the program.
Apart from this 'controlled' reset which occurs at the moment power goes on, there are another two resets called
Black-out and
Brown-outwhich may occur during the operation as well as at the moment the power supply goes off.
BLACK-OUT RESET
Black-out reset takes place when the power supply normally goes off. The microcontroller then has no time to do anything unpredictable simply because the voltage drops very fast beneath its minimum value. In other words the light goes off, curtain falls down and the show is over!
BROWN-OUT RESET
When the power supply voltage drops slowly (typical example is battery discharge, although the microcontroller experiences far faster voltage drops as slow processes), the internal electronics gradually stops to operate and the so called Brown-out reset occurs. Here, before the microcontroller completely stops the operation there is a real danger that circuits which operate at higher voltages start to perform unpredictably. Brown-out reset can also cause fatal changes in the program because it is saved in on-chip flash memory.
NOISE
This is a special type of Brown-out reset which occurs in industrial environment when the power supply voltage 'blinks' for a moment and drops beneath minimum level. Even short, such noise in power line may considerably affect the operation of the device.
MCLR PIN
A logic zero (0) on the MCLR pin causes an immediate and regular reset. It is recommended to connect it as per figure on the right. The function of additional components is to sustain 'pure' logic one (1) during normal operation. If their values are selected so as to provide high logic level on the pin after T reset is over, the microcontroller will immediately start the operation. This may be very useful when it is necessary to synchronize the operation of the microcontroller with additional electronics or the operation of several microcontrollers.
In order to avoid any error which may occur on
Brown-out reset, the PIC 16F887 has built in 'protection mechanism'. It is a simple, but effective circuit which responds every time the power supply voltage drops below 4V and keeps this level for more than 100 micro seconds. This circuit generates a reset signal and since that moment the whole microcontroller operates as if it has just been turned on.