Any way to safely reset by shorting to ground?

Thread Starter

Vaughanabe13

Joined May 4, 2009
102
So I know a short from your positive power rail to GND will cause a reset in an embedded system with a microcontroller. Let's say the power supply is +5V from a linear regulator.

What I want to know is can I somehow SAFELY short an output pin straight to ground in order to reset the micro? Here is what I'm thinking:

1) Connect an I/O pin of my micro directly to GND via a high-valued series resistor, maybe ~100K. At all times in the program the I/O pin will be at logic 0, so essentially it's a straight connection from GND to GND, aka nothing.
2) To power cycle the whole circuit (thus resetting the micro), I simply output a logic 1 on the I/O line of the micro, which will create a small current between the 5V rail and ground, determined by the series resistor. The pulse is nearly instantaneous this way because as soon as the power goes down the micro also resets and thus the I/O line of the micro drops immediately to 0V, thereby instantly releasing the reset pulse. Then the micro boots up again. At speeds that fast and with a low-current pulse, I have a hard time believing the regulator would sustain any damage or get heated up. But would such a low current even cause the power to cycle like that in the first place? If not, would it work if I connected the I/O pin to the base of an NPN transistor and connected the collector to 5V and the emitter to GND? This would create a very quick high-current pulse from 5V to ground through the transistor, resetting the power.

Basically I'm trying to figure out the best way to very quickly remove power from the circuit (without damaging anything or removing the power source from the circuit) in order to reset the micro. Thoughts?
 

Bosparra

Joined Feb 17, 2010
79
Why not just connect an output pin to the reset line with a transistor? This way you can reset the micro via software. You should also look into watchdog timers, which might be applicable, but I am not sure I understand what you are trying to achieve.
 

Markd77

Joined Sep 7, 2009
2,806
With the 100K resistor nothing would happen. The pin can easily source the tiny current which would flow.
Assuming you don't want to use the MCLR pin or similar, you could use a voltage regulator with an enable pin and suitable pull up/down resistor and connect that to your I/O pin. It's probably also possible to do it with a transistor or mosfet controlling the power to the micro.
 

Syniva

Joined Jun 21, 2010
25
I don't think I'd ever want to reset a circuit that way. It might work, if you use a MOSFET so that the signal from the microcontroller can suitably short the supply, but you risk eventual damage to either the MOSFET or the power supply or just the circuit traces between them. ...and there's no guarantee that you'll always get a clean reset out of it, which might not happen since as soon as the microcontroller ceases to function, the power may return immediately, and if the power-on reset wasn't triggered in that short period of time, there's no telling what the CPU will decide to do next.

Try using a 74HCT123 to generate a reset pulse. It is edge-triggered and so it will continue to generate the reset pulse even after the microcontroller ceases to function. Use an AND or an OR gate (depending on if your reset is active-high or active-low) to combine the pulse from the 74HCT123 with your existing power-on reset signal.

If you really want to remove power from the circuit, I would use a relay along with a 74HCT123 powered from the always-on side of the circuit, to make sure that the relay remains open for a long enough period of time. An opto-isolator to separate the always-on circuit from the switched circuit might also be nice to have, but I don't know that I would bother with one when using HC or HCT inputs since they don't supply much current.

In any event, power-on reset circuits aren't great at detecting small interruptions in power, and so if the interruption in power is too short, no reset pulse will be generated and your CPU may do strange things as a result, or simply not function at all.
 

Thread Starter

Vaughanabe13

Joined May 4, 2009
102
Thanks for all the responses! I have decided to not try this, for a combination of reasons listed above. I was pretty doubtful it would work, and your responses confirm that.

Basically this is a very special situation because my circuit will not actually have any direct interface to the regulator. I'm building a circuit that interfaces with another board that contains a CPU. My circuit draws its power from the Host board. The Host (CPU) circuit has a regulator, and the regulator DOES have a reset line, but because that reset line is not broken out of the Host board I can't change it with my micro.

So the effect I'm trying to achieve here is how do I reset the power on the Host CPU board if I don't have access to the regulator? I don't care if my micro loses power in the process, I just need to be able to reset the CPU. Unfortunately I think the only way I can do this is by hijacking the data lines of the CPU memory bus and forcing a reset vector. I'm going to look into that approach.
 

Papabravo

Joined Feb 24, 2006
21,225
Thanks for all the responses! I have decided to not try this, for a combination of reasons listed above. I was pretty doubtful it would work, and your responses confirm that.

Basically this is a very special situation because my circuit will not actually have any direct interface to the regulator. I'm building a circuit that interfaces with another board that contains a CPU. My circuit draws its power from the Host board. The Host (CPU) circuit has a regulator, and the regulator DOES have a reset line, but because that reset line is not broken out of the Host board I can't change it with my micro.

So the effect I'm trying to achieve here is how do I reset the power on the Host CPU board if I don't have access to the regulator? I don't care if my micro loses power in the process, I just need to be able to reset the CPU. Unfortunately I think the only way I can do this is by hijacking the data lines of the CPU memory bus and forcing a reset vector. I'm going to look into that approach.
ICK! Depending on the processor that may or may not be a good idea. Please Focus on the processor's RESET line. Examine the existing circuitry carefully and try to see if there is a way to adapt the circuit to your purposes.

For example: check to see if the thing driving the processor RESET has a pullup or pulldown resistor. If it does then doing a "wire-or" is a straightforward technique. Don't even worry about the regulator -- leave it alone
 
Top