Why are real-time clocks always 32.768khz?

I have a question, 2 infact.

What is the best oscilator circuit for a "clock crystal". circuits for 8+MHz crystals abund, can the same topologies be used for clock crystals ? I'm designing a clock circuit to drive an old firestation stncro clock but I'm having trouble keep my clock source stable.

Can the arduino be burned with a "watch crystal" bootloader ? it would be great for clock and timing applications where speed is not problem and low power is needed,

For 8MHz crystals, you normally connect the crystal between the output and input of an un-buffered inverter, with a high-value resistor (1M or greater) in parallel with it, and capacitors between both ends of the crystal and ground.

For 32768Hz crystals, this circuit needs to be modified by connecting a series resistor of a few hundred K between the inverter output and the crystal/capacitor. When I developed a RTC oscillator for a commercial computer many years ago, I found that 560K for the series resistor and 33M for the parallel one worked well. The reason I chose such a high value for the parallel resistor was to keep the current consumption as low as possible.

The atmega processors don't need either of these resistors if the fuses are set correctly, because they provide equivalent functionality in the chip. There is a separate fuse setting for "Low frequency crystal oscillator", see the datasheet.

You don't need a bootloader on the Arduino if you program it via ICSP.

Thank you. I'm using a counter IC with a built in oscillator but the datasheet only showed RC methods. I did follow a circuit like the one you describe but it was unstable, so I tried using a gate and the clock was stable but the counter still acted weird so maybe it's all the flying wires on my breadboard as running a "ground" wire from one end of the board to the other through the "mess" calmed it slightly.

Post a link to the datasheet, then we can see whether the oscillator is suitable for use with a crystal. Alternatively, get a 74HCU04 hex inverter (note the U in the part number), and use one of the inverters in that, unless that's what you are already using.

On a breadboard, use the power and ground buses normally provided, and keep the wires between the chips and those buses short. Connect a decoupling capacitor directly across each chip, not between the buses.

it's the MC14541B programmable timer IC

OK, I don't think you'll have much luck getting the oscillator in that chip to work with a crystal.

Right, well we did but mine was a bit unstable so I'm avoiding it.

Wristwatch is Wrist watch. The temperature range should be ~37°C and not 0°C to +40°C.

The 32kHz tuning fork crystal for watches has been chosen as a compromise of size and the fact it has a most stable region at 25-28degC, what is a typical temperature at your wrist. The ratio of wearing the watches on the wrist, afaik, is 16h/8h. So the watches crystal frequency is set. I have got a cheap kitchen clock with 4.194M crystal and it does a few seconds a year (!), what is a matter of luck, of course. Pls consider the capacitance used with the crystal as well, as it has a huge effect. For example a 1-2 pF change with a 32kHz watch crystal makes few seconds a day.
PS: pls mind the terms "stability", "precision" and "accuracy" are tricky when talking timekeeping :slight_smile:
A clock might be perfectly precise but inaccurate..
http://literature.agilent.com/litweb/pdf/5965-7984E.pdf

sparkylabs:
I have a question, 2 infact.

What is the best oscilator circuit for a "clock crystal". circuits for 8+MHz crystals abund, can the same topologies be used for clock crystals ? I'm designing a clock circuit to drive an old firestation stncro clock but I'm having trouble keep my clock source stable.

Can the arduino be burned with a "watch crystal" bootloader ? it would be great for clock and timing applications where speed is not problem and low power is needed,

What frequency do you need to generate? Yes, you can use a micro such as the arduino to generate a much more accurate signal than what you are working with right now. It will be as accurate as the crystal that clocks the micro.

Do you have the master clock too, or just slave(s)?

I'm working with a 32.768 KHz clock crystal

I'm asking for the arduino from an academic point of view. Of course having a secondary clock oscillator on the board that connects to an input pin with interrupt would be a better way of doing it so that the arduino can do plenty between clocks if needed.

sparkylabs:
Right, well we did but mine was a bit unstable so I'm avoiding it.

Well then, it did not work in that situation did it? My guess is, if it had worked adequately, you'd still be using it. Perhaps Dr. Dave was right after all.

What you could try is constructing an external crystal oscillator circuit, optimized for the type of crystal you want to use, or use a pre-built oscillator, then feed the output of that into the Rs input of the MC14541B.

Well I am messing about on a breadboard and with what looks like "transmission central" even using an external clock the timer chip does some funny stuff so I'm wondering if my instability is due to the mess of wiring or the part not being suitable. The chip will oscillate with the crystal but it was unstable, the lower frequency sections are also unstable though and I'm guessing that the higher in frequency I go the more unstable it becomes more quickly, that's all.

I can try wirig it up nice on some vero board to try and eliminate the long wires being a problem. Yes I could do with a diagram suited for a 32.768 KHz crystal and someone previously described one.

pito:

Wristwatch is Wrist watch. The temperature range should be ~37°C and not 0°C to +40°C.

The 32kHz tuning fork crystal for watches has been chosen as a compromise of size and the fact it has a most stable region at 25-28degC, what is a typical temperature at your wrist. The ratio of wearing the watches on the wrist, afaik, is 16h/8h. So the watches crystal frequency is set. I have got a cheap kitchen clock with 4.194M crystal and it does a few seconds a year (!), what is a matter of luck, of course. Pls consider the capacitance used with the crystal as well, as it has a huge effect. For example a 1-2 pF change with a 32kHz watch crystal makes few seconds a day.
PS: pls mind the terms "stability", "precision" and "accuracy" are tricky when talking timekeeping :slight_smile:
A clock might be perfectly precise but inaccurate..
http://literature.agilent.com/litweb/pdf/5965-7984E.pdf

Nice article. I particularly liked this paragraph:

The most accurate measurement known to humanity is the measure-
ment of the duration of the second. The peak of the pyramid for accu-
rate time and frequency is the international reference, UTC. The current
best accuracy for the determination of the second results in a time error
of ±0.3 nanoseconds (billionths of a second) per day. This is equivalent
to ±1 second in 10 million years.

As the article may be somewhat dated the current time error may be even less?

Lefty

sparkylabs:
Yes I could do with a diagram suited for a 32.768 KHz crystal and someone previously described one.

You really need clean breadboard techniques for something like this. Follow dc42's recommendations and make sure your breadboard is making good contact with the wires (no worn contacts, no corroded wires). You can try the attached circuit.

As the article may be somewhat dated the current time error may be even less?

10y back I messed with OCXOs and I did measurements with a counter which used the cesium standard (connected to w-w cesium network) as the time base. The guy operating the stuff told me the 10^-14 to 10^-15 long term stability was the status at that time. With better networks today the UTC might be determined even better.. I have to call him again :slight_smile:

You can try the attached circuit.

The 32khz watch crystals are provided for a specific load capacitance, usually a single capacitor connected to the oscillator's input against the gnd. The typical capacitance is 6pF or 12.5pF - you have to check the datasheet of the crystal. Not sure the loading with 2x18pF (those basically connected in series give you 9pF, plus stray capacitance) will give you good results when the crystal is intended ie. for 6pF, though.

pito:
Not sure the loading with 2x18pF (those basically connected in series give you 9pF, plus stray capacitances) will give you good results when the crystal is intended ie. for 6pF, though.

The values I show in my circuit are what worked for me. Like the link says, you can try R1=20M, r2=500K and caps between 10 and 20 pF.

I may have had a stubborn crystal, hence the 330K I used, and it's the only thing that really concerns me as these watch crystals do not like too much drive. However, if it shatters or ages too much, I'll try a new crystal with 500K but will keep everything else the same.

I would use an RTC chip (my favorite is the pcf8563t - 200nA operation) as, afaik, all have a programmable square wave available at the clock out pin. The default output (open drain, enabled at power on) is 32kHz and you may set it to ie. 1024 Hz, 32 Hz, and 1 Hz at least with above chip. The chip is fine-tuned for 32khz crystals, and, as a bonus, you'll get an RTC as well :).

retrolefty:

The most accurate measurement known to humanity is the measure-
ment of the duration of the second. The peak of the pyramid for accu-
rate time and frequency is the international reference, UTC. The current
best accuracy for the determination of the second results in a time error
of ±0.3 nanoseconds (billionths of a second) per day. This is equivalent
to ±1 second in 10 million years.

As the article may be somewhat dated the current time error may be even less?
Lefty

off by one second 3.7 billion years from now or New Strides Toward Better Clocks, Accurate to One Second in 32 Billion Years, 5/2011

off by one second 3.7 billion years from now