Autoreset Circuit on Uno

retrolefty:

doov:
Hi There,

I'm mildly confused as to how the autoreset circuit works on the arduino uno. I assume DTR goes low when the serial transmission from the PC begins. That discharges the 100 nF cap which pulls the reset line low. With a time constant determined by the 10k pullup to 5V and the 100 nF cap the cap will recharge and the reset line will be high. I assume that the bootloader takes over right after the reset line goes high at which point it slurps up whatever it gets over the serial line as program code and then resets the processors instruction pointer. Is that correct? Is there any indication when programming is complete? How long is DTR pulled low for (I don't have a scope :(). Thanks!

D

Yes that is basically how it works. The IDE (via AVRDUDE) just pulses the DTR signal on then off to cause the AVR to reset

Not exactly.
The DTR signal is not pulsed. It is a level.
DTR is set by the OS when the serial port is opened before the application gets control of the serial port.
By default DTR is high.The OS sets DTR low (not the application) when the first open occurs
and then back to high when the last close occurs.
DTR is used as a single to know if there is anything attached to the serial interface.
High - nothing is there. Low something is there listening.
The capacitor is a h/w kludge that turns the falling edge of the DTR signal into a pulse
to reset the AVR.

Some operating system have the ability to change this DTR behavior but normally
that is the way DTR works.

RTS on the other hand is normally used for hardware flow control but the application
can control its level after the the application has opened the serial port.
The IDE or avrdude can pulse RTS - which they do to perform an auto reset,
because some hardware uses RTS vs DTR.

Some Arduino boards use DTR some use RTS.

Summary:
OS changes DTR from high to low when application opens port before application
has control of port. Capacitor is used to change falling edge to pulse.
RTS is used for h/w flow control but can be controlled by application after port is opened.

The IDE and avrdude upload can work with boards that use DTR or RTS for autoreset.

I prefer RTS over DTR for autoreset because with RTS you only get an autoreset when
code is being uploaded to the board.
But with DTR you get an autoreset every time the port is opened by an
application which means you can't open the serial port to talk to the arduino without reseting it.

--- bill