A short article with review of different emergency reset methods available within the pic microcontroller. Here will be some theory and some practice of course.
So what is the reset – it is a reboot of the uC, all registers are being cleared and everything restarted. It might be generated by the external circuitry or by the internal chip logic.
POR
Power On Reset – the reset during the power up procedure. Used since we need to hold a certain pause till we can normally use the microcontroller, this delay could be adjusted by two timers: the power-up timer and the OST. The first one is switchable and can create up to 72ms, the second one always on and the period is equal to 1024 Tosc. The threshold of the reset lies in 1.2…1.7V borders. If we would like to check how does it work we can add the next code to any program:
if (!POR) { printf("\r\nPOR!"); }
I did not have a scope at the point of the time, so can’t show the waveforms.
BOR
This reset is dedicated to protect your code from unwanted unpredictable conditions and it can happen in the next two cases
1 : The smooth descending of the supply voltage (for instance, a battery is discharged), the example of such situation is shown below:
Don’t pay the attention to borders, I just put some random values, in the real chip the lower border was about 3V.
2 : the noise, with the noise we might have large glitches which might cause unexpected problems.
That’s basically it. For BOR checkup we need to enable BOREN in the code and put POR and BOR to 1.
{ if (!POR) { POR = 1; BOR = 1; printf("\r\nPOR!"); }
A noisy video:
That’s all theory we need so far.
No sources, since this already just a couple of code strings