TONY NIXON 54964 wrote: > > On previous experience, crystals do not give a good time base for a > clock as the frequency varies quite a bit with temperature. I can get > +/- five or ten minute error over 1 day. The mains is reasonably > accurate for this purpose. ( Most commercial clocks rely on this fact.) > > I would like to know if this is the best method for long term > accuracy or if there is a better way. (Albeit cheap). > > Tony Hi Tony, As you possibly know, all AC mains voltages in capital cities in Australia are trimmed to give an accurate cycle timing on any given day, over any given week, etc. I guess it depends on if you are counting cycles for some sort of accurate timing application, or are you really needing a real time clock that requires battery backup? I feel the best method to implement a real time clock at a reasonable price, is to use one of the chips designed for the job such as the DS-1302 with battery backup, and the *** CORRECT *** load capacity crystal. Even after all this, the time won't be accurate. You will still need to trim it with software. If you are running a PIC, you have a ready made micro to log the +/- offset say at midnight every Saturday night. When you have a definitive result, you can adjust the time once a week. Most other 'cheap' methods won't give the result you need for an accurate Real Time Clock. Wrist watches are better time keepers. I don't know why! Don McKenzie don@dontronics.com http://www.dontronics.com SLI, the serial LCD that auto detects baud rates from 100 to 125K bps. SimmStick(tm) A PIC proto PCB the size of a 30 pin Simm Memory Module. Covers all versions of the PIC16cxx family plus the Atmel AT89C2051.