Improved Reset / Power Down Alarm Circuit

Using inexpensive transistors and

79x05 or 78x05 regulators

Author: William G. Grimm

May 23, 2003

Consultant – Avorex Design

Introduction

Data sheets for PIC micro-controllers have typically included recommended reset circuits. While these perform well in most applications, and are not needed at all in many others, they are inadequate in some applications. Such an applications would be when the PIC is controlling or taking inputs from circuits with voltages higher than its +5v supply voltage. In these applications the PIC can be up and running before its inputs from the higher voltage circuits are valid, or, even worse, turning on systems whose voltage levels have declined at turn off or brown out. In these applications designers may have considered using micro-processor supervisory circuits that cost more than the PIC itself. This application note describes how to avoid this.

The following describes two circuits (in figures 2 and 3) that can be used to provide a PIC with a reliable reset at both power on and power down. These circuits may be used when the PIC gets its power through a voltage regulator.

The short coming of often published reset circuits is that they measure only the +5 volt line supplying the PIC. Using such circuits for reset means that when the PIC reset is drawn low at power down the voltage on the PIC is already below +5 volts. The voltage could be below the safe operating range of the part, corrupting the program counter. At best, little time is given between the assertion of the reset and the power line going below spec.

In operation this can shown itself as products going out of calibration at power down, and processors coming up without a valid reset on power up.

Circuit description

Figure 1 shows the circuit published with the data sheets of PIC16c5x and PIC12c5xx parts and performs well in most circumstances. The point at which VDD must drop is given by equation 1:

(equation 1) VDD(R2/(R1 + R2)) = 0.7 volts

When VDD is above the threshold level, Q1 is conducting, taking the MCLR line high. When VDD is below the threshold Q1 is turned off and MCLR is brought low by R3. Resistor tolerances of R1 and R2 will create uncertainties in the VDD reset trigger level. Moreover, at power down the processor will not be drawn into reset much before VDD goes too low for proper operation, making for a time critical situation. At power up, the processor will not be brought out of reset much before the voltage has become adequate, again making for a time critical situation.

Figure 2 shows how the circuit in figure 1 can be modified to eliminate the time criticality without adding parts. U2 is the regulator used to provide regulated 5 volt power to the PIC. U2 is not meant to be an additional voltage regulator, but the one already in the design. In this example it is a negative voltage regulator. Q1 is turned on in normal operation, and turns off when VIN falls below a level define by equation 2:

(equation 2) VIN(R2/(R1 + R2)) = 0.7 volts

Solving equation 2 for R1 gives the means for calculating R1 based on the VIN you need to reach for safe microcontroller operation:

(equation 3) R1 = ((VIN/0.7 volts) – 1) * 1K

Here VIN is not near 5 volts, but at some voltage above the regulator drop out voltage[1] and below the normal operating voltage. At power down this voltage will decline well before the supply voltage. The result is that the PIC MCLR line will be brought to Vss level while its supply voltage (VDD-VSS) is still +5, yielding more predictable results.

At power on, the MCLR line stays near Vss level until the voltage regulator has passed its drop out range. The PIC will not come out of reset until VDD-VSS has stability at 5 volts.

Sensing at the power supply side of the regulator allows the sensing of a wider voltage range and is much more forgiving of unit to unit variations in the values of R1 and R2.

Since many designs cannot use negative supplies, the circuit in figure 3 has been included. U2 is again used to power the PIC, but is now has the more common positive regulator. Q1 is now an NPN transistor, but its operation is still defined by equation 2. Q2 is used as a logic inverter stage and could be replaced by a spare 74HC04 or 74HC14 gate if one is available.

Both circuits in figures 2 and 3 have been tested with 78L05, 78L05, 7905 and 7805 linear regulators and found to be reliable. Utilizing these circuits with switching regulators has not been tested but should perform just as well.

[1] Regulator drop out voltage is 7.3 volts for 78/79L05 and 7.5 volts for 78/7905. National Semiconductor National Power IC's Databook, 1995.