My Arduino AtMega328P board has this circuit for reset. I understand the switch (LTSpice didn't have a switch symbol) pulls the line low, thats obvious, but what does the cap do when reset comes through DTR? Does it invert the signal or only allow a pulse?
enter image description here
1 Answer 1
Yes.
It converts the level-triggered signal DTR into an edge-triggered signal and has the effect of level shifting it to within the operating voltage range of the MCU (+/- a forward diode drop).
DTR (Data Terminal Ready) is a signal line used for hardware flow-control in various EIA serial protocols (such as EIA-232). In your case, it is being "hacked" to serve as a host-initiated reset of your microcontroller.
Ease-of-use
The host has software control over the state of the DTR line, but implementing a short pulse may not be possible due to scheduling or other tasking in the way.
Speed
Perhaps you want a really fast reset (you don't want a user to notice the micro went through a reset), this wouldn't be possible with software control of the reset line directly through DTR. You'd have to send a low-level, then a high-level via your host software.
Level Translation
The DTR line may be at EIA-232 levels, many volts higher (and lower) than the microcontroller can safely tolerate. AC coupling the reset edge severely limits the current (waveform energy) such that it may be safely clamped by the ESD protection diodes attached to the reset pin inside the microchip.
-
1\$\begingroup\$ +1 for the: it is being "hacked" to serve as a host-initiated reset of your microcontroller. \$\endgroup\$Garrett Fogerlie– Garrett Fogerlie2013年03月19日 21:34:45 +00:00Commented Mar 19, 2013 at 21:34
-
2\$\begingroup\$ I don't agree that the AC coupling severely limits the current. In fact I'm shocked at the poor design. Reason: When DTR is high, there's no problem... Then it goes low and drags the reset line low "almost instantanously". No problemo so far and the cap charges thru the resistor and attains Vcc on the reset line side and low on the DTR side. Some time later DTR returns high... what happens is that a pulse of Vcc x2 is fed into the reset line. Therefore the circuit looks badly designed and is likely to damage some silicon unless there are components not shown. \$\endgroup\$Andy aka– Andy aka2013年03月19日 22:01:12 +00:00Commented Mar 19, 2013 at 22:01
-
\$\begingroup\$ Many AVRs support using the reset pin as a GPIO, in that case you have to use a 12v pulse on the reset line to be able to re-program it, not sure if that's the case on the AVR in question, but a 2x Vcc pulse could very well be in spec \$\endgroup\$Gorloth– Gorloth2013年03月20日 03:15:41 +00:00Commented Mar 20, 2013 at 3:15
-
\$\begingroup\$ @Andy -- The majority of the energy in a fast-edge-rate, low-repetition-rate signal is the low end of the spectrum (approaching 0 as repetition rate decreases). The capacitor here forms a high-pass filter that cuts out the low-end. As to the edge itself, the reset pin has TVS diodes that can handle an occasional edge like that. They are rated for at least 5KV HBM. \$\endgroup\$DrFriedParts– DrFriedParts2013年03月20日 03:47:21 +00:00Commented Mar 20, 2013 at 3:47
-
\$\begingroup\$ OK - I've just checked and the pin can take +/-40mA (absolute max rating) and be raised as high as 13V so I guess it will be OK but this depends on DTR inherently being current limited to below 40mA or being limited to below about 10V. \$\endgroup\$Andy aka– Andy aka2013年03月20日 08:28:04 +00:00Commented Mar 20, 2013 at 8:28