Go Down

Topic: an idea.. (Read 2018 times) previous topic - next topic


To make a serial enabled clock is a good idea, but whenever you close the serial connection, the board seems to 'reset'  thus loosing data, unless it is stored in EEPROM.
Could the Arduino have some sort or time keeping function, or a shield for this?

Or is this an invalid idea?


Apr 14, 2010, 08:52 am Last Edit: Apr 14, 2010, 08:52 am by retrolefty Reason: 1
A lot of people needing real time clock/calendar functions either build or buy one based on the DS-1307 I2C RTC chip. Here is a commercial version:


Also pretty easy to build your own on a protoshield board.



The arduino resetting is normal, its the tradeoff for the conveinece of the auto-reset used when uploading a sketch.  Its Possible to hardware disable it (which also stops the auto reset working) and usually possible at the PC end to stop it toggling the DTR connection in software which then means the board doesn't reset.  How its achieved on your particular setup will vary.  Googling "Arduino disable auto-reset" and your operating system / application should yield some clues.


Incidentally, the seeed version of the Arduino has an on-board switch to disable auto-reset. Seeing retrolefty's post reminded me (Since he's a big Seeed fan).  


I have been using the DS1337 on my boards. Very similar ot the DS1307 but has two
interrupt outputs.

Information on my boards and clock example code is at http://wiblocks.luciani.org/NB1/NB1A-index.html

(* jcl *)

www: http://www.wiblocks.com
twitter: http://twitter.com/wiblocks
blog: http://luciani.org


I installed a DS1307 on my home-made lcd/button shield.  I used a DIP switch to enable and disable the power and comm lines to the clock if I decide to use the outputs for another project.  The battery keeps the clock going and I can easily change the DIP switches and upload the clock sketch any time I wish to use the clock again.

You can get a DS1307 from Maxim as a sample from their website.  That's how I got mine.  I scavenged a battery holder from an old computer mother board and the crystal from an old watch.  My only cost was my time.

Go Up