DS1307 accuracy


I have a DS1307 / 28X based project which has gained about 2 minutes over the last few months. Although this is not bad, has anyone ever tried to trim out such errors?
I am toying with slapping a 5-15 pF variable cap on the 'live' side of the crystal but without any data on the crystal or guidance from the Dallas datasheet, I have no idea if this will work. Come to that, the datasheet does not indicate which is the 'live' side.
I found this in the datasheet:

The DS1307 can also be driven by an
external 32.768 kHz oscillator. In this configuration, the X1 pin is connected to the external oscillator
signal and the X2 pin is floated.

could this mean the X1 pin is the pin you need ?

you can also check out Application note 58 from Dalas:


Edited by - dave_h on 3/29/2005 9:45:48 PM


Thanks, that app note gives the details I need. It looks like X2 is the 'live' pin.
Unfortunately though it looks like 5pF (the minimum on the trimmers I have) will be too much and even if I could get the right value, temperature drift would be not far behind the level of error I already have.
20ppm is nothing to moan about though, might have a go at reducing it anyway.


Senior Member
One way to get very small capacitance values - which used to be used a lot to trim up RF circuits 50 years ago is to put in a small length of twisted pair wire - such as a section of CAT5 or even two pieces of magnet wire twisted together. Then you can trim downward in capacitance either by untwisting some at the open end or clipping bits off... it was called a 'gimmick'.
Dalas states that the DS1307 has a freq. drift of 20 ppm or 1 minute a mont. you can always notice the real drift and compensate for this in your application. this takes some time to messure :) or keep the temperature constant at the optimal value :)

Seems that Dalas also has something like the DS32Khz, a 32.768kHz Temperature-Compensated Crystal Oscillator this device has only a ~1ppm drift a year and works as a replacement for the 32.768 Khz xtal.


New Member
I dont know which ds1307 the board uses, but I know there are two versions. One wants ~12pf on the crystal, the other wants !5pf I believe.

I've used external oscillators and indeed you just hook it to pin 1, and either let pin2 float (these are the X pins I mean, not physical pin numbers) or you can ground it through a 1 Mohm+ resistor in an RC network with ~15 pf. This sometimes works and sometimes doesn't...dont ask me why.

The best option for extreeme accuracy would be an external TCXO in an oven. Probably overboard though, but it's one hell of a stable clock pulse.


New Member
I started typing and didn't finish before dave posted...

dave said:
Seems that Dalas also has something like the DS32Khz, a 32.768kHz Temperature-Compensated Crystal Oscillator this device has only a ~1ppm drift a year and works as a replacement for the 32.768 Khz xtal.

I says:

I have 2 ds32khz's, and actually just ordered another 5 on thursday. Thes things are...what do my kids say...the shizzle nizzle. The footprint isn't out of control, but they're taller than a normal chip. Not wrist watch stuff, but they're much much better than just a crystal. I've found so many uses for them (not just time keeping) that they're right next to my box of 08's...which I use more than anything else I think. I dont even put them in drawers with everyhting else, because I just grab em constantly.

Edit: Anoother note on the ds32khz...yes it's temp compensated, but it doesn't compensate at light speed. A constant in and out or hot and cold will mess it up as it keeps trying to compensate for temp changes. Be aware of this prior the application because if it goes through alot of fast dramatic temp changes, it's cost and size will not be justifiable vs a goot crystal oscillator.

Edited by - andypro on 3/29/2005 10:28:45 PM


Thanks for all the tips and in particular the one about temperature compensation on the DS32Khz. My project does indeed cycle over 30C every 12hrs so I'll have to keep an eye on things.


New Member
30C over 12 hours shouldn't pose the least bit of problem for he ds32khz. 30C over a minute or two over and over does. That's what I was trying to get at. Sorry if I wasn't clear.


Technical Support
Staff member

5.70 GBP + P&P + VAT for the standard spec 14-pin DIP, one off.