Auto-reset fix for Uno and Mega 2650 #22

Closed
wants to merge 2 commits into
from

Projects

None yet

4 participants

@giseburt

This is a modification of the usbserial code for the 8u2 chip. The intent is to make auto-reset only work when programming, and remain backwards compatible with the software.

I added a check for an about 1 second delay between DTR toggles before the reset line is switched. This allows connection and reconnection from OS X and (untested) Linux without a reset.

Also optimized for size, since this check pushed the size over 4K. It might be a little faster as well.

I've also included HEX files for both UNO and Mega 2650, but I haven't tested the UNO files. (I don't have an UNO, sorry.) I did NOT include the combined HEX file that have the DFU programmer in them.

giseburt added some commits Mar 26, 2011
@giseburt giseburt Make auto-reset only work when programming.
Added a check for an about 1 second delay between DTR toggles before the reset line is switched. This allows connection and reconnection form OS X and (untested) Linux without a reset.

Also optimized for size, since this check pushed the size over 4K. It might be a little faster as well.
3a7dc40
@giseburt giseburt Added hex files for uno and mega 2560.
I haven't tested the UNO file yet.
fec59ca
@damellis
Member

I'd like to keep the current behavior of the 8U2 firmware in this respect. That is, it should merely pass through the DTR state changes made by the operating system. I know the auto-reset on serial connection is annoying in some cases, but it's useful in others and also the established behavior.

@damellis damellis closed this Mar 29, 2011
@giseburt

I tried very hard to remove only the unwanted resets, leaving the
established behavior that is expected. That was the real goal.

If someone wants to force a reset they still can with two DTR toggles
one second apart.

I believe that most projects are not expecting or wanting the whole
device to reset upon establishing a serial connection. They simply
have to deal with it now or physically alter the board to permanenty
remove that.

Thank you for listening,
-Rob

PS: I wrote a blog post that explains motivations:
http://www.tinkerin.gs/2011/03/arduino-auto-reset-software-fix.html

On Mar 29, 2011, at 9:15 AM, damellis
reply@reply.github.com
wrote:

I'd like to keep the current behavior of the 8U2 firmware in this respect. That is, it should merely pass through the DTR state changes made by the operating system. I know the auto-reset on serial connection is annoying in some cases, but it's useful in others and also the established behavior.

Reply to this email directly or view it on GitHub:
#22 (comment)

@andyross

Could we get more discussion about this? Are there alternatives you'd consider? Is giseburt's "knocking" algorithm not acceptable for getting a reset done from the host?

While I accept that the reset behavior is there for legacy compatibility, I honestly consider it a bug. Plugging or unpluging a data cable really shouldn't be resetting the unit by design.

@NicoHood
Contributor
NicoHood commented Dec 7, 2014

You wont break older board i think, but the really use of this is minimal. There are so many boards out there delivered with the old firmware, i think this wont help much. You still can do this for your board if you like to via DFU. Thats my opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment