Hi Tony, In the US, the frequency of the mains is regulated by law. Both short-term and long-term error are required to be within certain limits. The long-term error limit is far better than most crystal controlled clocks. If you clean up and current limit a signal from the mains, then keep tra ck of the average number of instruction cycles for each mains pulse, you can _also_ keep very accurate time during a power outage. (Assuming you have a rechargeable back-up battery on floating standby-- great for smoothing the input power also.) As for greater accuracy, the US government has short wave radio stations WWV and WWVB in Colorado, and WWVH in Hawaii which broadcast atomically accurate time signals. Some of their signals are formatted for computer reception. Even the verbal time channels have beeps at regular intervals which can be used to correct for crystal drift. The main problem with the beeps method is that the time it takes radio signals to propagate from the transmitter to you fluctuates. You would need a continuous, moving average over a long period to get a good measurement. Another source for greater accuracy is the internet. There are several locations around the world from which you can request the exact time. There is a lag for transmission through the network of servers, but the long-term error of your clock would be nil. For periodic resetting methods, you can use the trick of self-adaptive precision. Each time the clock is reset, figure how long it has been since it was reset and what the error was. You then adjust the number of instruction cycles you wait between increments of the clock's smallest unit. You can also have a daily correction factor to increase the precision. (Pause or jump ahead x number of instruction cycles by modifying the delay counter.) Frequencies: WWV: (male voice - Fort Collins, Colorado) 2,500 kHz 2.5 kWatts 5,000 kHz 10 kW 10,000 kHz 10 kW 15,000 kHz 10 kW 20,000 kHz 2.5 kW WWVH: (female voice - Kekaha, Kauai, Hawaii) 2,500 kHz 5kW 5,000 kHz 10kW 10,000 kHz 10kW 15,000 kHz 10kW WWVB: (continuous BCD time code - Fort Collins, Colorado) 60kHz 13kW Many other countries have similar transmitters, often on similar frequencies. Best Wishes, Eric. >On Mon, 10 Mar 1997, TONY NIXON 54964 wrote: > > I need to make a clock that is accurate. It will be powered by the > mains, and I thought of using this as a time base as it is a fairly > stable waveform. > > Does anyone else know of a way which will be more accurate? > > Regards > > Tony.