Maxim > Design Support > Technical Documents > Application Notes > Microprocessor Supervisor Circuits > APP 581
Keywords: power on reset, por, push-button reset, manual reset, debounced, power fail, watchdog timer,strobe timer, selectable reset timeout, reset threshold, programming 8051, microprocessor supervisor APPLICATION NOTE 581
Advantages of Using a MicroMonitor and a SimpleApplication Demonstrating the Use of a DS1232
May 17, 2001
Abstract: Discusses how the DS1232 can be used to MicroMonitor an 8051-based system. This
supervisor circuit provides power-on-reset (POR), manual reset (push-button) input, a watchdog timer(strobe timer), and an early power-fail comparator. The reset threshold tolerance can set selected tomonitor both 5% and 10% supply tolerance systems. In addition, a pin-selectable reset time-out delay isavailable.
To simplify the use of the device, a software execution program is included to show how the 8051processor can be used in conjunction with the DS1232.
Introduction
Maxim's DS1232 MicroMonitor chip is a highly integrated solution to add power-on reset delay, apushbutton reset controller, robust power failure monitoring, and watchdog timer functionality to yourmicroprocessor system with the addition of a single chip. The chip also offers both active and low resetsignals, and selectivity of the watchdog time out period and the voltage monitoring level. The high levelof integration reduces both the cost of implementation and the board space required. The chips areavailable in several packages including 8-pin mSOP, SOIC, and DIP.
Advantages of Using a Dallas Semiconductor DS1232MicroMonitor
Power-on Reset Delay Allows Board Resources to Stabilize Before Execution Begins
Precise control of a microcontroller's reset pin is important at all times during the operation of a circuit.Thus, it is imperative that the reset pin is controlled during both normal operation and during the power-up time of the circuit. One common problem with many microprocessor circuits is that the microcontrollerbegins execution before the memory and I/O resources available to it have a stable power supply. Somechips require hundreds of milliseconds to reset themselves and ready for operation. If a microprocessorbegins execution within microseconds of a reset, it could be executing based on invalid input from thesystem resources. This can be resolved by adding a power-on reset (POR) circuit that holds the
microprocessor in reset during the power-up sequence for 100s of milliseconds after a reset occurs. TheDS1232 will hold a microcontroller's reset pin active for a minimum time of 250ms (typically 610 ms.)Additionally, it can provide either an active high or active low reset, which makes it compatible with anymicroprocessor.
Pushbutton Reset Circuit Debounces a Momentary Switch and Provides a Solid ResetPulse
Another common problem in microprocessor circuits is that a less than perfect reset signal causes themicroprocessor to reset several times, possibly executing some fragment of the initialization routineseveral times before the reset finally stabilizes. In some circuits, this is trivial. However, in other circuitsthis could cause major system problems. The DS1232 has internal circuitry that debounces a pushbuttonand provides the system a clean reset signal. This eliminates the need to have both a separate power-on reset circuit and pushbutton circuitry attached separately to the reset pin. Plus, the DS1232 will holdthe reset pin low for at least 250 ms to guarantee that the manual reset is received correctly by themicroprocessor every time.
The DS1232 Provides Power Failure Monitoring
Brownouts and power failures are a reality for most microprocessor systems. Since there is no way toavoid the occasional power cycle, a robust microprocessor solution must account for the various powerfailure modes. The DS1232 monitors the power supply to a microprocessor and forces the
microprocessor into its reset state if there is a brownout or if the power fails altogether. This guaranteesthat the system will not try to operate during irregular supply voltage conditions, and it can prevent themicroprocessor from executing code when it should really be waiting for the supply voltage to return to avalid state.
An Internal Watchdog Timer MAY Reset a Microprocessor, but an External WatchdogWILL Reset It
Watchdog timers are used to ensure that if the code operating on a microprocessor enters into anunanticipated state, then the processor will reset after some minimal amount of time elapses. Manymicroprocessors have an internal watchdog timer that handles this function without an external
component. However, the internal watchdog timer can be disabled by the pseudo-random code that isexecuting on the microprocessor. The external watchdog timer on the DS1232 cannot be disabled. Thisgives you peace of mind, knowing that if the MicroMonitor is not strobed, then the microcontroller will bereset. Another nice feature of the DS1232 is that the strobe period can be varied to one of three differentvalues. The device thus works well with faster and slower microprocessors because you can program thewatchdog timer to an appropriate rate for any microcontroller. Another advantage of the external
watchdog timer is that the strobe signal is visible to the external world because it is on an I/O pin. Thisallows easier debugging of watchdog-related problems.
Hardware Required for Using a DS1232 with a Microcontroller
The greatest asset of the DS1232 is that all of the functions listed above are implemented in a singlepackage. This functionality does not require a complex chipset. The schematic below shows how theDS1232 is used with a Dallas Semiconductor DS87C520 Microcontroller. Since most systems
incorporate a pushbutton reset, the only things added are the DS1232, a pull-up resistor for the activelow output, and a decoupling capacitor to reduce the possibility of noise on the power supply causing areset. The pull-up resistor is added here because it is used to generate the oscilloscope plots shown onthe following pages. The active-low RST output of the DS1232 is not required by the DS87C520. TheLEDs on the diagram are used to signal when ISRs (Interrupt Service Requests) are being serviced.
Figure 3. Typical active-low RST signal during power-up sequence: 1) VCC 2) active-low RST.
After the reset signal becomes inactive, the microcontroller must strobe the ST signal low before thewatchdog timer elapses. The DS1232's watchdog timer cannot be disabled, so this must occur within nms of the reset signals becoming inactive, or the microprocessor will be reset. The watchdog time-outvalues for the DS1232 are programmable and specified with somewhat wide ranges. However, it is bestto strobe the ST pin faster than the minimum watchdog time-out specification, because it eliminates thechance that a fast watchdog will cause the system to erroneously reset. The watchdog time-out can beset to one of three values by adjusting the value of the TD pin according to Table 1.Table 1. Watchdog Time-Out Values for Each TD Pin State
TD Pin StateMinimum Time-OutTypical Time-OutMaximum Time-OutGroundFloatingVCC
62.5 ms250 ms500 ms
150 ms600 ms1200 ms
250 ms1000 ms2000 ms
Figure 1 shows the TD pin grounded, and hence ST must see a negative edge every 62.5ms to
guarantee that the microprocessor will not be reset. If it is strobed at the typical rate of 150 ms, there isa chance that it would work with one MicroMonitor but not another. The inclusion of the minimum, typicaland maximum values informs the end user of the behavior of the watchdog. Program the TD such thatthe microprocessor can strobe the ST pin before it reaches the minimum time-out and plan on it takingas long as the maximum time-out to reset the microcontroller. The typical value does not apply to anyspecific MicroMonitor; it simply shows that the critical time is between the minimum and maximum time-out value. Thus, the typical value for any given MicroMonitor could range anywhere between theminimum and maximum time-out values.
Figure 4 (below) shows the strobe signal that was used for the same hardware setup. Trace # 1 showsVCC and #2 shows ST. As the same hardware was used with the reset signals shown in Figures 2 and3, the reset was de-asserted at ~460ms. The first negative edge of the strobe signal occurs at 496 ms,or 36 ms after reset becomes inactive. This is sufficiently early to guarantee that the watchdog will notreset the system unless the microcontroller enters an unanticipated state.
Figure 4. Watchdog strobe signal (ST) at the beginning of execution: 1)VCC 2) ST.
As you can see from Figure 5 (below), the ST signal receives a negative-edge approximately every 20ms. With a faster microprocessor, there is no reason not to strobe more often than required. Also, on thisgraph it is easy to see that the strobes start to occur at 496 ms after the voltage is applied.
Figure 5. Zoom showing frequence of the ST signal: 1)VCC 2) ST.
The DS1232 will also debounce a momentary switch without additional hardware, making it easy to adda pushbutton reset to over-ride the system. The pushbutton is shown in Figure 1, and the RST andactive-low RST signals it causes are shown in Figures 6 and 7. Note that the pushbutton does notbounce when connected to the DS1232 and that the reset is held for approximately the same period oftime as a reset during power-up (610 ms typically). Also note that a pull-up resistor is not required forthe pushbutton, because an internal pull-up resistor is available within the DS1232.