# Help me understand what's going on with the reset circuit in this simulation.

I was trying to understand how the Arduino's original reset circuit worked so I could get a better grasp on why it was changed and how those changes affected the behavior of it, when I found this thread: http://www.adafruit.com/forums/viewtopic.php?f=25&t=42192

It mentioned that the voltage would jump up to 10V when DTS went high again. Come again?

I decided to simulate the circuit, and I confirmed it was true:

Simulation

But I don't understand what's going on.

When I flip the DTS to high, both sides of the capacitor are at 5V. When I flip it to low, the voltage on the reset line drops to 0V momentarily, then rises back to 5V. The side of the capacitor connected to it is now at 5V, and the side connected to DTS is at 0V. So far so good. The capacitor is charged.

But when I flip DTS back to high, the reset line jumps to 10V. I'm having a hard time grasping why that happens.

In Rev3 there is a diode clamp, D2, from the reset pin to 5 volts, therefore the voltage on the reset pin will go to 5.7 volts momentarily, not 10 volts. Without the diode this will be 10, i.e. 5v+5v

Does this help... http://forum.arduino.cc/index.php?topic=22783.msg172216#msg172216

With no diode in the circuit:
When CTS is 0 volts the capacitor C5 is charged to +5 volts on the righthand side, by the 10K reset resistor.
When U3, CTS goes to +5 volts on the left handside this 5 volts is added to the righthand side 5 volts giving you 10 volts.

Coding:
Well, it explains it, but at the same time, it doesn’t.

What is the mechanism which causes the other side of the capacitor to rise to 10V? Is it the like charges repelling?

That doesn’t seem to make sense though if I think about it as electrons and holes instead of charges. The plate on the reset side is lacking electrons. When the other plate goes from negative to positive… well, I guess the plate on the side of reset might not be completely depleted of electrons. So that could force some more out maybe, thus making it even more positively charged?

So I guess it kinda makes sense?

What is the mechanism which causes the other side of the capacitor to rise to 10V?

My understanding is that the rise is caused by more electrons transferring from one side to the other. If you have five volts worth of electrons already collected on side B (using @Grumpy_Mike's example) and side A quickly goes from zero volts to five volts then five more volts worth of electrons passes from B to A. At that instant, side B is at five volts and side A reaches ten volts.

Okay, well I guess my next question is, why does the new reset circuit have two capacitors?

Actually, I noticed it's only the Leonardo that has two caps. The Uno does not. Nor does the Ethernet.

Futhermore, the Leonardo's two caps are connected on the 5V side of the diode and resistor, then to ground. But the single cap on the Uno and Ethernet is connected to the reset line and ground.

The two are very different circuits, and neither one seems to work as it's supposed to with the simulator I'm using. Instead of the results I was getting before which mostly made sense, now when I flip flop the DTR line, I just get 5V or 0V on the reset line, and the voltage doesn't revert via the cap as before:

http://goo.gl/zjES7n

I also see no action on the diode. It seems to do nothing.

Is the simulator broken? It could be. But if it is, what about the different placement of the caps in the schematics? Which is correct? Do both work, or is one wrong?

I guess the main difference is in the Leonardo you have two caps to ground, with a resistor between them and the reset line, whereas in the Uno you have one cap to ground with no resistor between it and the reset line. So I guess they're not totally different. But still no clue which is better or why they're different.

Also doesn't explain why the simulator doesn't actually show them doing anything.

Show/post your schematics or simulation pictures here. Do not post links to java applets. So you can discuss the stuff in detail.

Pito: If you don't want to click the links because you're concerned then don't, but posting an image of a simulation defeats the purpose when I'm trying to show people what's happening with the simulated circuit.

I still haven't had any success with the actual Uno circuit, but I've made some progress. This variation seems to work how it's supposed to, at least for the DTS portion:

http://goo.gl/D0b3t9

I still need to add the reset button to this and figure out how to make it function the same way though.

Well, this seems to work...

http://goo.gl/XJEeFy

It doesn't drop and bounce back on its own while the button is held, but it does go back to 5v after you release it which ought to have the same effect. I'd rather it snap back to 5v while held down though. Would feel more responsive.

The basic way how to discuss electronics is with a schematics (pictures), simulation results (pictures, numbers), placed here in this post within this discussion. You can easily refer to components, voltages, currents etc then.
You can hardly discuss an animation somewhere out of this thread. People who understand electronics do not need to mess with animated java stuff somewhere in the cloud in order to help you. They need to see a concrete schematics you are referring to (a picture) and simulation results (a picture) when necessary. And they may help you then.

Pito: The schematics I am referring to are all on this site. I'm talking about the differences between the Uno and Leonardo auto reset circuits.

The first few simulations I posted were simulations of those circuits. The simulations indicated they would not behave the way they should. The only thing a screenshot of the simulator would show you is that the circuit I constructed is identical to the one in the schematic.

Either the simulator is wrong, or the schematics are wrong. You have the schematics., so at the very least you can see that they should, or should not work as advertised, and explain why they are different.

If I posted a picture of the simulator all you would see is a still image of the circuit in the UNO schematic, with an osilliscope output showing a square wave on the reset pin when I switch the DTS high and low.

Btw Pito, neither of your schematics actually represent the Uno or Leonardo reset circuits. Whether your circuits are correct or not, I don't know, but what I'm trying to figure out here is if the Uno and Leonardo schematics are correct.

I just looked at your schematics Pito. It seems you have a square wave generator V1 connected to DTS. But why is V1 also connected to ground? I can't tell from your still image if when V1 outputs 5V it goes to both traces attached to it or not, and that would make a difference whether R2 is connected to ground or... 2.5V? when V1 is on.

I'm gonna see if I can figure out LTspice and try simulating the circuit in that. It's high time I started using a decent tool instead of that Java app. I just hope it has a way to show the current flow. I find it very helpful in visualizing what's going on.

I also see no action on the diode. It seems to do nothing.

The purpose of the diode is to simply clamp any voltage applied to the reset pin above +5 vdc as can happen with the way the auto-reset functions that the arduino IDE used to force a reset to the AVR chip before uploading new sketch. The diode was added to the Uno rev3 boards after this reset 'bug' was finally understood and could be demonstrated. It was a subtle bug but the diode fixed it.

Yes, I get that... But it wasn't doing anything in the simulation of the Uno or Leonardo circuits. When DTS went low, reset simply followed DTS. It didn't go low, and then high again.

I haven't figured out the problem with the Leonardo schematic, and I've given up on it, but I have finally had some success simulating the Uno schematic.

Here is the Uno schematic:

And here is the simulation of it: Sim: http://goo.gl/DNRTxu

As you can see it now peaks slightly above 5V. So far so good.

But look at what happens when I set Vcc to 3.3V: Sim: http://goo.gl/bkByZb

That is with a diode forward voltage of 700mv. Approximately the fv of the diode Crossroads says is used on the Uno: http://forum.arduino.cc/index.php?topic=86389.msg1178112#msg1178112

In order to keep the spikes below 3.6v, I have to set the diode's fv to less than 325mv.

I suppose that doesn't matter on the Uno (or the boards that use the 32U4) because the reset pin is special and can handle up to 13v regardless of Vcc. But I thought I'd mention it because I'm looking at using an Xmega and the reset pins on those are the same as any other pin, aside from a 25K internal pullup so their reset pin can't stand more than 3.8v max.

Anyway, I guess my problem is resolved.

Um. Leonardo doesn't have an auto-reset circuit, because it doesn't have a serial port in between the USB and the chip. The two caps you're looking at in the schematics "near" the reset signal are just bypass caps between +5V and GND.