Abstract:
A system and method for detecting brown-out conditions in a microcontroller, enabling a user to program the brown out detection system, and distinguishing between real brown-out events and transitory voltage swings without requiring expensive and time consuming logic. The invention compares a sense voltage to a reference voltage and filters the resulting signal to distinguish between a true-brown out signal and transitory voltage swings. The invention uses one or more program bits that vary the ratio of the supply voltage and the sense voltage. That is, the sense voltage is programmable and is dependent upon the value of the supply voltage and the value of the program bits. The present invention generates a comparison output signal based upon the comparison of the supply voltage and the sense voltage. The comparison output signal is filtered to distinguish between a real brown-out event and transitory voltage swings.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The invention relates to the field of computer microcontrollers and more particularly to the field of programmable brown-out detection in a microcontroller environment. 
     2. Description of Background Art 
     Recent advances in technology have led to an increase in performance and a decrease in size of semiconductor microcontroller or microprocessor chips. Microcontrollers are devices that can control the operation of many items, e.g., braking systems in automobiles, automatic water sprinklers, and cellular telephones. Microcontrollers generally receive power from a supply voltage that is external to the microcontroller. In order to ensure proper operation, many conventional microcontrollers employ a brown-out detection system for detecting drops in the voltage level of a signal received from the supply voltage. 
     Brown-out detection systems detect when a supply voltage level drops below a minimum level that is necessary for proper operation of the microcontroller and/or the item using the microcontroller. Brown-out detection systems protect the microcontroller against total power failure and against &#34;dips&#34; in the received voltage signal. 
     In some conventional brown-out systems the received voltage signal is compared with a predetermined voltage reference signal. If the received voltage signal drops below the predetermined voltage reference signal the microcontroller issues a reset signal which ensures that the microcontroller will not operate with a low input voltage which, otherwise, can result in a malfunction of the microcontroller. A problem with such conventional systems is the requirement that the reference voltage and the ratio between the supply voltage and a voltage supply comparison voltage be predetermined. 
     Another problem with conventional brown-out detection systems is that they are not capable of distinguishing between a real brown-out condition from mere signal noise without expensive circuitry which requires additional elements, e.g., hysteresis logic. As an example, a true brown-out event may correspond to a sustained drop in the level of the received voltage signal or may correspond to a fast deep drop in the voltage signal level. However, transitory noise from input/output (I/O) switching, for example, can cause relatively shallow dips of the supply voltage which drop below the reference voltage and quickly return to an acceptable voltage level. Conventional brown-out detection circuits immediately initiates a microcontroller reset after the first instance of the voltage level dropping below the voltage reference. The operation of the microcontroller begins again only if the received voltage signal level exceeds the reference voltage after the expiration of a set period. Such conventional systems cause an unnecessary disruption in the microcontroller operation. 
     Some conventional systems disclose a device that purports to distinguish between real brown-out events and transitory voltage swings. However, such systems require expensive logic including multiple filters and hysteresis. Specifically, U.S. Pat. No. 5,606,511 to Yach (hereafter referred to as &#34;Yach&#34;), which is incorporated by reference herein in its entirety, describes a brown-out detection system that purports to distinguish between real brown-out conditions and transitory noise signals. Yach describes a system in which at least two voltages are sampled and filtered from the voltage supply signal (V DD ), see FIG. 2, 5A, and 5B in Yach, for example. Yach requires two separate filtered voltage sample signals (V1 and V2). The V1 signal is filtered once and the V2 signal is filtered twice, see FIGS. 5A and 5B in Yach. The voltage level of V1 and V2 with respect to V DD  is based solely upon the filters and upon the resistors 36, 37, and 38 in FIG. 5B, i.e., the values of V1 and V2 are not programmable and are used merely to provide hysteresis boundaries. The hysteresis voltages (V1, V2) are both compared to a reference voltage and a reset signal is only generated if the voltage level of both V1 and V2 are less than the reference voltage. Similarly, the Yach system only clears the reset (begins normal operation) after the voltage level of both V1 and V2 exceed the reference voltage. Yach states beginning at column 2, line 53 that &#34; h!ysteresis greatly assists the dual comparator to distinguish a true brown-out event from normal noise or other slight perturbations, and is achieved be dual sampling of the power supply and establishing a pair of trip points for comparison with excursion of the supply voltage level.&#34; It is apparent that the Yach system is a complex and expensive technique. 
     What is needed is a system and method: (1) for detecting brown-out conditions in a microcontroller; (2) for enabling a user to program the brown out detection system; and (3) for distinguishing between real brown-out events and transitory voltage swings without requiring expensive and time consuming logic. 
     SUMMARY OF THE INVENTION 
     The invention is a system and method for detecting brown-out conditions in a microcontroller, enabling a user to program the brown out detection system, and distinguishing between real brown-out events and transitory voltage swings without requiring expensive and time consuming logic. The invention compares a sense voltage to a reference voltage and filters the resulting signal to distinguish between a true-brown out signal and transitory voltage swings. The invention uses one or more program bits that vary the ratio of the supply voltage and the sense voltage. That is, the sense voltage is programmable and is dependent upon the value of the supply voltage and the value of the program bits. The present invention generates a comparison output signal based upon the comparison of the supply voltage and the sense voltage. The comparison output signal is filtered to distinguish between a real brown-out event and transitory voltage swings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram of a brown-out detection circuit according to one embodiment of the present invention. 
     FIG. 2 is a more detailed illustration of the brown-out detection circuit according to one embodiment of the present invention. 
     FIG. 3 are timing diagrams illustrating the voltage levels at various nodes of the brown-out detection circuit illustrated in FIG. 2 for a supply voltage signal according to one embodiment of the present invention. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     A preferred embodiment of the present invention is now described with reference to the figures where like reference numbers indicate identical or functionally similar elements. Also in the figures, the left most digits of each reference number corresponds to the figure in which the reference number is first used. 
     FIG. 1 is a block diagram of a brown-out detection circuit according to one embodiment of the present invention. The brown-out detection circuit of one embodiment includes a programmable voltage module 102, a reference voltage module 104, a comparator 106, a filter 108, and an optional buffer amplifier 110. The programmable voltage module 102 receives the supply voltage V DD  and one or more program bits. In one embodiment of the present invention two program bits (P1 and P2) are used. The programmable voltage module 102 outputs a voltage V SENSE  that is received by the comparator 106. The value of V SENSE  is dependent upon the value of V DD  and the value of the program bits (P1, P2). The reference voltage module 104 generates a reference voltage (V REF ) that is received by the comparator 106. The comparator 106 compares V SENSE  and V REF  to generate a signal V COMPOUT  that is filtered by the filter 108 to distinguish between a true brown-out condition and a transient voltage drop. The filtered signal can be received by a buffer and amplifier 110 that translates V COMPOUT  to logic levels compatible with the system in which the brown out system is used. 
     FIG. 2 is a more detailed illustration of the brown-out detection circuit according to one embodiment of the present invention. In this embodiment the programmable voltage module 102 includes five resistors and two transistors. The resistors are R1A, R1B, R2A, R2B, and R2C. The transistors are n-channel metal oxide semiconductor field effect transistors (nmos) and are referred to as MN7A, MN7B in FIG. 2. In this embodiment R1A is a 4 kilo-ohm (k) resistor, R1B is a 28 k resistor, R2C is a 20 k resistor, R2B is a 10 k resistor, and R2A is a 10 k resistor. The two transistors have a width of 10 microns (U) and a length of 1 U. MN7A receives the first program signal (P1) at its gate and operates in parallel with resistor R2B. MN7B receives the second program signal (P2) at its gate and operates in parallel with resistor R2A. 
     The output of the programmable voltage module (V SENSE ) appears at the node between resistor R1B and R2C. The programmable voltage module receives a signal from the supply voltage (V DD ) and divides the voltage using the resistors (R1A-B, R2A-C) to generate the output voltage V SENSE  that is proportional to the supply voltage V DD . However, the ratio of V SENSE  /V DD  is programmable by the user. Specifically, if the user sets the first program signal (P1) high, the gate of MN7A will exceed its source and the transistor MN7A conducts to effectively form a short circuit in parallel to resistor R2B. The result is that the ratio of V SENSE  /V DD  decreases and the output voltage V SENSE  decreases for a given supply voltage. 
     Similarly, if the user sets the second program signal (P2) high, the gate of MN7B will exceed its source and the transistor MN7B conducts to effectively form a short circuit in parallel to resistor R2A. The result is that the ratio of V SENSE  /V DD  decreases and the output voltage V SENSE  decreases for a given supply voltage. If both P1 and P2 are set high, the ratio further decreases. It will be apparent to persons skilled in the art that various resistor values and transistor strengths can be used without departing from the scope of the present invention. In alternate embodiments, additional transistor/resistor pairs are present and additional program signals are received in order to enable the user to more precisely set the V SENSE  /V DD  ratio. 
     The reference voltage module 104 includes three transistors and a resistor. The three transistors are nmos transistors MN1A and MN1B and p-channel metal oxide semiconductor field effect transistor (pmos) MP9. The resistor is reference number R5. In this embodiment transistors MN1A and MN1B each have a length of 5 U and a width of 10 U. Transistor MP9 has a length of 2 U and a width of 15 U. Resistor R5 has a resistance of 400 k, which can be accomplished using a transistor having a length of 250 U and having a width of 2.5 U, for example. The reference signal V REF  is the signal at the node between the drain of MN1A and the drain of MP9. It will be apparent that the reference voltage is substantially constant and does not substantially vary based upon variations in the supply voltage V DD  because the impedance of resistor R5 is so great when compared to the incremental impedance across MN1A and MN1B. 
     The comparator 106 includes five transistors. nmos transistors MN3 and MN4 and pmos transistors MP6, MP7, and MP8. In this embodiment, transistors MN3 and MN4 have a width of 20 U and a length of 4 U. Transistors MP6 and MP7 have length of 2 U and a width of 20 U and transistor MP8 has a length of 2 U and a width of 10 U. When the gate of MP8 is low compared to its source, MP8 conducts and biases MP6 and MP7. When V SENSE  exceeds V REF  MP7 is conducting while MP6 is not significantly conducting and V COMPOUT  begins rising. When V REF  exceeds V SENSE  MP6 is conducting while MP6 is not significantly conducting and V COMPOUT  begins decreasing. The output of the comparator 106 is a signal at the drain of MN3, i.e., V COMPOUT . 
     The output of the comparator 106 (V COMPOUT ) is filtered using, in this embodiment, an RC filter 108 comprising capacitor C1 and resistor R3. In the embodiment illustrated in FIG. 2 the resistor is a 2000 k resistor and the capacitor has a capacitance of approximately 3 picofarads. The filter 108 reduces the effect of transient voltage variations. For example, a small voltage variation or a small voltage spike is filtered so that a brown out signal is not generated to eliminate unnecessary brown out signals. However, the filter 106 does not prevent the detection of a large voltage variation, e.g., a large voltage spike. That is, the filter 108 distinguishes between a real brown-out condition and a transient voltage variation. The output of the filter 106 is received by the buffer 110. 
     The buffer 110 includes two transistors identified as MP5 and MN2. Transistor MP5 is a pmos transistor having a length of 2 U and a width of 10 U. Transistor MN2 is an nmos transistor having a length of 2 U and a width of 10 U. The buffer 110 illustrated in FIG. 2 is an inverter that buffers the output of the comparator 106 and filter 108. The output of the buffer 110 is a brown out signal (BR --  OUT). In one embodiment, the brown out signal is transmitted through additional logic (not shown) such that the signal (BR --  OUT) transitions quickly between a &#34;low&#34; voltage and a &#34;high&#34; voltage and vice versa. One example of such logic is a series of inverters. The operation of the brown-out circuit illustrated in FIG. 2 is described in additional detail below with reference to the timing diagram example illustrated in FIG. 3. 
     Although optional for the present invention, FIG. 2 illustrates an additional shut down function that will cause the present invention to generate a brown-out signal (BR --  OUT). The shutdown function logic includes transistors MP1, MP2, MP3, and MN5. In one embodiment, MP1 is a pmos transistor having a length of 2 U and a width of 10 U, MP2 is a pmos transistor having a length of 3 U and a width of 20 U, MP3 is a pmos transistor having a length of 1 U and a width of 5 U, and MN5 is an nmos transistor having a length of 1 U and a width of 5 U. The shutdown signal (SHDN) and its complementary value (SHDN --  N) are received in the locations illustrated in FIG. 2. In shutdown mode the SHDN signal is high which causes transistor MP3 to conduct and brings the gate of transistor MP5 to a voltage low enough to cause MP5 to conduct. Transistor MP5 conducts and the brown-out signal is proportional to V DD . 
     FIG. 3 are timing diagrams illustrating the voltage levels at various nodes of the brown-out detection circuit illustrated in FIG. 2 for a supply voltage signal according to one embodiment of the present invention. One example of a supply voltage signal (V DD ) is illustrated in the timing diagram 3(a). The voltages received by the comparator 106 (V REF  and V SENSE ) are illustrated in the timing diagram 3(b). The filtered voltage signal V COMPOUT  is illustrated in the timing diagram 3(c). The brown out signal (BR --  OUT) output from the buffer 110 is illustrated in the timing diagram 3(d). 
     At time T 0  the supply voltage signal begins a voltage spike. At this time V SENSE  begins decreasing, while V REF  remains substantially constant. At T 1  V SENSE  drops below V REF  and the value of V COMPOUT  begins to drop. The supply voltage V DD  begins to increase at T 2  and is back to its normal value, e.g., 5 volts or 3.3. volts, at time T 3 . Due to the filter 110, the voltage level of the filtered signal V COMPOUT  drops slowly until it drops below a minimum required voltage level at time T 2  which causes the brown out signal (BR --OUT ) to begin rising. At time T 3  V COMPOUT  begins rising and reaches its original voltage level at time T 4 . The brown out signal reaches its peak at T 5  and is back to its original voltage level at time T 4 . 
     While the invention has been particularly shown and described with reference to a preferred embodiment and several alternate embodiments, it will be understood by persons skilled in the relevant art that various changes in form and details can be made therein without departing from the spirit and scope of the invention.