Supervisor Circuit for Your Embedded Projects

by Bardia Alikhan Afshar in Circuits > Microcontrollers

965 Views, 0 Favorites, 0 Comments

Supervisor Circuit for Your Embedded Projects

IMG_2607.JPG

I got emails about supervisor IC that I used on my other instructable projects. I decided to explain what the supervisor circuit and its details are. We will design a header board based on the MIC1832 Supervisor Chip from Microchip, and STM32F030K6T6, an ARM-Cortex M0 microcontroller, to see the result in action.


So, what is a supervisor circuit?

Nowadays, electronic circuits and especially embedded systems are everywhere. You can find it in our homes, cars, workplaces, factories, etc.

To ensure that these systems work well in various environments, including some harsh environments, such as industrial and automotive applications, the system's designers must include precise and redundant monitoring to ensure that the microcontrollers/microprocessors will work fine.

What is monitored by a supervisor circuit?

A supervisor circuit can monitor many parameters. These chips range from simple three-terminal reset chips to complex multifunction devices. Take the voltage, temperature, and clock signal as an example. These parameters should be monitored continuously to ensure the reliability of the system.

We will go into depth in microcontroller supervisor circuits.

The most fundamental function of a microprocessor (µP) supervisor is that of "power-on-reset" (POR). Otherwise, well-behaved µP-based systems can exhibit problems during power-up or when the supply voltage sags temporarily (brownout). For many years, the partial solution to this problem has been the addition of a resistor, a capacitor, and a diode to the µP's Active-low RESET line. You can even see this type of design these days. This method works reasonably well for power-up as long as the power supply rises quickly with respect to the RC time constant. The circuit's job is to protect the µP from less-than-perfect power-ups, but it relies on the supply voltage to rise quickly enough for that purpose. It is also unreliable in resetting the µP during a brownout. Microprocessor vendors often recommend a circuit with Zener diodes and transistors to handle this situation. It forces a reset when the power supply drops, but voltage accuracy is limited to that of the Zener diode combined with errors associated with the transistor characteristics.

 

Having said all of the problems above, using discrete external supervisor chips can be the right choice.

Power-Supply Monitoring Is Not Enough? Watchdog Timers are here!

Basic supervisors provide the primary supervisory function, such as voltage monitor. But many applications require more functions to be monitored. Another common requirement for microprocessor-based systems is the watchdog timer (WDT). WDTs provide protection against rogue software and other aberrations that cause software execution to "run off into the weeds." The processor periodically sends a pulse to the watchdog timer to indicate that the system software is operating properly. If the watchdog timer does not receive this pulse within an allotted time frame (known as the watchdog timeout), the watchdog timer asserts a reset output. Many µPs have internal watchdog timers, but many of these WDTs do not provide complete protection. Often the WDT can be disabled as well as enabled by software. If software can disable the WDT, then the WDT cannot completely protect the system from software. To remove this liability, you need an external hardware watchdog timer that cannot be disabled by software. Watchdog timers provide a method for alerting a system or resetting a processor whose software has experienced a freeze or hang. While no one purposely designs software to freeze, good system designers plan for failures anyway – as it’s always better to prepare for the unexpected.

 

 

What Now? Let’s use that supervisor.

Now that we are familiar with supervisor circuits, we want to implement it on PCB alongside our microcontroller. for this purpose, I will use MIC1832MY. I got these chips as samples from Microchip (Thanks!!!).

It is a 3.3Volt supervisor circuit that includes a watchdog timer, power supply monitor, microprocessor reset, and manual pushbutton reset input.

MIC1832MY Details

Untitled-1.jpg

The MIC1832 is a low-current microprocessor supervisor for monitoring 3.3V and 3V systems. The device features logic-selectable (TOL) reset thresholds of 10% or 20% of 3.3V; a pushbutton reset input; a watchdog timer with three-state selectable (TD) timeout periods of 150ms, 600ms, or 1.2s; a fixed reset timeout period of 250ms(min); and active-low open-drain reset (/RST) and active-high push-pull reset (RST) outputs. The /RST output maintains a valid reset condition for VCC as low as 1.4V. The MIC1832 asserts a reset condition if the supply voltage drops below the reset threshold, the pushbutton reset is asserted low, or the watchdog timer does not see a high-to-low transition on the watchdog timer input within the watchdog timer period. A reset condition is held for the reset timeout period of 250ms (min) after the pushbutton input is released after the supply voltage increases above the reset threshold voltage, or after the watchdog has initiated a reset. 

Pin Details :


 /PBRST: Pushbutton Reset input: This input is debounced and can be driven with external logic signals or by using a mechanical pushbutton to actively force a reset. All pulses less than 1ms in duration on the /PBRST pin are ignored; any pulse with a duration of 20ms or greater is guaranteed to cause a reset. 

TD: Time Delay input: This input selects the timebase used by the watchdog timer. When TD = 0V, the watchdog timeout period is set to a normal value of 150ms. When TD = open, the watchdog timeout period is set to a nominal value of 600ms. When TD = VCC, the watchdog period is 1.2s nominally.

TOL: Tolerance Select input: This input selects whether 10% or 20% of VCC is used as the reset threshold voltage. When TOL = 0V, the 10% tolerance level is selected and when TOL = VCC, a 20% tolerance level is selected. 

GND: IC ground pin, 0V reference 

RST: RST is asserted high if either VCC goes below the reset threshold, the watchdog times out, or /PBRST is pulled low for a minimum of 20ms. RST remains asserted for one reset timeout period after VCC exceeds the reset threshold, after the watch times out, or after /PBRST goes high. 

/RST: /RST is asserted low if either VCC goes below the reset threshold, the watchdog times out, or /PBRST is pulled low for a minimum of 20ms. /RST remains asserted for one reset timeout period after VCC exceeds the reset threshold, after the watch times out, or after /PBRST goes high. Open-drain output.

/ST: Input to watchdog timer. If /ST does not see a transition from high to low within the watchdog timeout period, RST and /RST are asserted. 

VCC: Primary supply input.

Downloads

PCB & Schematic

Schematic_1.jpg
PCB.jpg
F8ZSBFEL3A6283Z.jpg

Having explained the supervisor circuits, I decided to design a mini header board based on STM32F030K6T6 to see the results. I uploaded the schematic, which is very easy. Unfortunately, the Zip file is not supported by Instructables. If you need Gerber files, send me an email.

I designed it in Altium designer. And ordered the PCBs from JLCPCB. The quality of PCB is excellent. I ordered 5 pieces of PCBs for 1.85$. As soon as I got them, I started to solder all the components. You can see the latest PCB in the images.

Downloads

Results & Conclusion

IMG_4402.jpg
IMG_4412.jpg

As you can see from the schematic, I connected the TD pin to 3.3 volts. This means that if the MIC1832 does not get the signal in 1.2 seconds, it will reset the microcontroller. It is evident in the first image that the supervisor circuit works properly. As it does not get any signal, it resets the microcontroller. As soon as I generated a signal on the PA4 of the microcontroller, the reset procedure was stopped by MIC1832. And the reset pin remained constant at 3.3 volts.


If you want to increase the safety of your microcontroller-based project, it is wise to use supervisor circuits. In this way, you know that you have an external supervisor circuit apart from the internal watchdog that can handle problematic microcontroller situations.