3.12 Reset! Black-Out, Brown-Out Or Noises?
At first glance, it is sufficient to turn the power on to make the microcontroller operate. At first glance, it is sufficient to turn the power off to make it stop operating. Just at first glance... De facto, start and end of operation depend on a special signal called RESET.
A reset condition causes the microcontroller to immediately stop operation and clear its regis ters. A reset signal may be generated externally at any moment (the MCLR pin is driven low). It can also be generated by from within the microcontroller if needed. A power-on condition always causes a reset to occur. Since there are many accompanying occurrences taking place when the 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 independent timers PWRT and OST are in charge of that. The first one can be enabled or disabled during the process programming. Let’s see what really happens here:
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 startup timer generates another reset signal within 1024 quartz oscillator periods. When this time delay expires (marked as T reset in figure on the right) and the MCLR pin is driven high, the microcontroller can start to execute the first program instruction.
In addition to this so called ‘controlled’ reset which occurs at the moment the power supply goes on, there are another two reset conditions called Black-out and Brown-out which may occur during the operation of the microcontroller as well as at the moment the power supply goes off.
BLACK-OUT RESET
The black-out reset takes place when the microcontroller is properly turned off. In this case the microcontroller has no time to do anything unpredictable because the power supply voltage drops very fast under its minimum value. In other wordsthe light goes off, curtain falls down and the show is over.
BROWN-OUT RESET
When the power supply voltage drops slowly (a typical example is a 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. Before the microcontroller completely stops operating there is a risk that circuits which operate at higher voltages start to perform unpredictably. The brown-out reset can also be fatal for the program as it is saved in on-chip flash memory.
NOISE
Noise 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 the minimum level. Even short, such a noise in power supply may considerably affect the operation of the microcontroller.
MCLR PIN
A logic zero (0) on the MCLR pin causes the microcontroller to be reset immediately and in a proper way. 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 these components are set so as to provide a high logic level (1) on the MCLR pin after T reset is over, the microcontroller will immediately start to operate. This condition may be very useful when it is necessary to synchronize the operation of the microcontroller and additional electronics as well as operation of several microcontrollers.
In order to avoid any error which may occur on Brown-out reset, the PIC 16F887 has a built-in ‘protection mechanism’. It is a simple, but effective circuit which responds every time the power supply voltage drops below 4V for more than 100 micro seconds. This circuit generates a reset signal and since that moment the microcontroller operates as if it had just been turned on.