Arduino Time.h – Resets on Serial Connection for Sync

arduinoserialtime

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?

Best Answer

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.