Oct 3, 2020

Use a Voltage Detector to Create a Fast, Clean Input to your Microcontroller

The question was asked of how to fix a very slow-rising power supply which is causing a poor start of micro?


The basic function you're looking for is a comparator; something that looks at a change (that may be slow) and makes a quick change at a set threshold. Furthermore, most designs have some amount of hysteresis to avoid rapid on-off switching.


You can solve it by fixing the power supply or forcing the MCU to wait until the power is good.

The problem of a poor startup on circuits especially microcontrollers is a long-standing one. There is a family of inexpensive 3-terminal devices specifically for this problem from most companies. They are usually used to hold the Reset line of the processor in the Reset state until the voltage has reached stability at the desired voltage. They will often include a time-delay as well after the threshold before releasing the reset line to assure a clean start. They are called "Power On Reset" or "IC Supervisors" or "Voltage Detector" or simply "PMIC" and they are just a comparator in a transistor-looking package. For example: some devices at Digikey.

You'll see that you select the device to match the polarity of the reset, and the desired fixed voltage to switch.


Similar functions are built into many voltage regulators: it's the input for "under-voltage lockout."
If you have full control of the design you could use either of these methods to control the regulator or the MCU on the board. However, if you want to add this "after market" to an existing system, and if you can access the reset line directly, then connect drive it with one of these. 

Here's how I think I would do it.

Use the Voltage Detector as your comparator, but use its output to drive the ENable of a load switch IC; this is basically a mosfet transistor optimized for pass-through function. An example of one is an ADP1290ACBZ-R7 from analog devices. The input of the load switch is the slow supply; the output is a clean switch at V_threshold of ~ 2.8 - 3.0V.

[todo: pair with a suitable voltage divider and show circuit...]

No comments: