Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I realize and understand the problem with arduino boards resetting whenever you open a serial connection as stated and answered here.

However, because of that I'm trying to figure out how various arduino-based clocks can actually handle a time sync over serial without just resetting every time.

For example, the BulbDial clock checks for a sync every time the loop comes around. But trying to sync via the processing sketch would just reset the controller and it would miss the sync. Granted, I do not have one of these clocks, but I based by design for the sync off of it and every time I open the serial connection to send the sync, the board just resets.

Is there something that I am missing?

Now, I have gotten it to work by placing a 10 uF cap between RESET and GND. But since others are able to do this without that cap I'd love to be able to do it without as well.

I've also written a python script that will set the time and I've tried all sorts of DTR, RTS configurations to try to force those lines to stay high and not reset the board during connection but I've had no luck. Code below:

    com = serial.Serial()
    com.baudrate = baud
    com.port = port
    com.timeout = 1
    com.rtscts=True
    com.dsrdtr=True
    print com
    com.open()

Any thoughts on how this is supposed to be done?

share|improve this question

2 Answers

In this case, I think you have to disable the reset-on-serial-connect function by modifying the board. Searching for 'arduino disable auto-reset' for how to do this to various arduino boards. It will be board specific but most involve adding a bleed resistor across the reset capacitor, removing a capacitor, or cutting a trace on the board.

share|improve this answer

There technically is no need to modify the board. The answers to the linked question are not quite correct in their assumption - in actuality this occurs due to software behavior (of the connected PC) rather than something forced by the hardware.

It is possible to configure the host operating system serial API to not automatically command set/clear of the DTR signal upon connection/release, and thus avoid the resetting entirely in software. For example on linux/unix, you want to disable the HUPCL setting in termios; not exactly sure how you do that in python, though running something else (such as the stty tool) might be an option.

However it remains susceptible to being reset by software which does not take care to avoid this, and perhaps by the first usage of the port after boot (unless the change of configuration is made more permanent). For those reasons, a special purpose design would likely not have the hardware to support auto-reset, or have a jumper to enable/disable it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.