Skip to content

Auto-reset fix for Uno and Mega 2650 #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

giseburt
Copy link

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.

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.
I haven't tested the UNO file yet.
@damellis
Copy link
Contributor

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
Copy link
Author

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
[email protected]
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
Copy link

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
Copy link
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.

tbowmo pushed a commit to tbowmo/Arduino that referenced this pull request Jul 14, 2016
Changed from Switch/case to if/elseif to save some runtime ram
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants