DS1307 Clock runs fast

Started by kg4pid January 3, 2009
I have a project that uses a Dallas 1307 clock chip. Got the code
working but the clock runs a little fast, gains about 2 seconds a day.
What can I do to slow it down a bit? I'm thinking that a small trimmer
cap connected to one leg of the crystal to ground might work but I
don't have any to try and don't know what value is needed so I don't
know what to order. Also if I build another one and it runs slow what
can be done to speed it up a little. I know there are more accurate
clocks available but they come at a higher cost so I just need to be
able to adjust what I have.

Thanks, Max
Max,
XCOs for precission work like clocks will always need tuning/adjustment
for good accuracy.
You're lucky its gaining, something can be done about this. If it were
slowing the only solution
would be to get a different xtal with other specs.... unless the chip
has some built-in oscillator
tuning bits.

Just place a good tempstable trimmer of about 40pF (such a trimmer would
be adjustable over some 4-45pF)
from one xtal pin to GND, and a 20pF fixed cap from the other pin to GND.
I bet this will fix the problem.

kg4pid skrev:
>
> I have a project that uses a Dallas 1307 clock chip. Got the code
> working but the clock runs a little fast, gains about 2 seconds a day.
> What can I do to slow it down a bit? I'm thinking that a small trimmer
> cap connected to one leg of the crystal to ground might work but I
> don't have any to try and don't know what value is needed so I don't
> know what to order. Also if I build another one and it runs slow what
> can be done to speed it up a little. I know there are more accurate
> clocks available but they come at a higher cost so I just need to be
> able to adjust what I have.
>
> Thanks, Max
>

--
*******************************************
VISIT MY HOME PAGE:

LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen
I just found this clock circuit, but I'm confused as to why the
trimmer cap is connected to a positive voltage instead of ground. It
is a different clock chip but the same principal. The DS1307 has an
input for the backup battery so it doesn't need the diodes.

http://www.winpicprog.co.uk/pic_tutorial_i2c_clock_board.htm

Should I do the same with the DS1307?

Max

--- In p..., Eirik Karlsen wrote:
>
> Max,
> XCOs for precission work like clocks will always need
tuning/adjustment
> for good accuracy.
> You're lucky its gaining, something can be done about this. If it
were
> slowing the only solution
> would be to get a different xtal with other specs.... unless the
chip
> has some built-in oscillator
> tuning bits.
>
> Just place a good tempstable trimmer of about 40pF (such a trimmer
would
> be adjustable over some 4-45pF)
> from one xtal pin to GND, and a 20pF fixed cap from the other pin
to GND.
> I bet this will fix the problem.
>
> kg4pid skrev:
> >
> > I have a project that uses a Dallas 1307 clock chip. Got the code
> > working but the clock runs a little fast, gains about 2 seconds
a day.
> > What can I do to slow it down a bit? I'm thinking that a small
trimmer
> > cap connected to one leg of the crystal to ground might work but
I
> > don't have any to try and don't know what value is needed so I
don't
> > know what to order. Also if I build another one and it runs slow
what
> > can be done to speed it up a little. I know there are more
accurate
> > clocks available but they come at a higher cost so I just need
to be
> > able to adjust what I have.
> >
> > Thanks, Max
> > --
> *******************************************
> VISIT MY HOME PAGE:
>
> LAST UPDATED: 23/08/2003
> *******************************************
> Regards
> Eirik Karlsen
>

It doesn't matter, VDD is also AC ground, if things are done correctly.
In many cases one can find tuning and timing capacitors connected to
VCC when they in principal should have been connected to GND.
Some designers do this to this as personal preference, or because it
makes a cleaner looking
schematic, or simply because the PCB layout gets simpler or better.

But in this case I think the 'designer' has made a flawed design...he
has left out that all important
VCC-VDD decoupeling capacitor. His circuit may work but I'll bet it
would work better if
it had a supply decoupeling cap, especially as he is using the VCC pin
as a AC return point.

kg4pid skrev:
>
> I just found this clock circuit, but I'm confused as to why the
> trimmer cap is connected to a positive voltage instead of ground. It
> is a different clock chip but the same principal. The DS1307 has an
> input for the backup battery so it doesn't need the diodes.
>
> http://www.winpicprog.co.uk/pic_tutorial_i2c_clock_board.htm
> Should I do the same with the DS1307?
>
> Max
>
> .
>
>

--
*******************************************
VISIT MY HOME PAGE:

LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen
Even more confusion because the backup battery has been drawn in backwards
(upside down). Personally I have a lot of trouble with the symbols - VDD and
VSS, I can never remember which is which and to make it worse their meanings
(polarities) are different depending on whether you are dealing with NMOS or
PMOS or CMOS. I really wish the original convention of VCC and GND had
stuck, without introducing all these fangled terms.

On 1/4/09, Eirik Karlsen wrote:
>
> It doesn't matter, VDD is also AC ground, if things are done correctly.
> In many cases one can find tuning and timing capacitors connected to
> VCC when they in principal should have been connected to GND.
> Some designers do this to this as personal preference, or because it makes
> a cleaner looking
> schematic, or simply because the PCB layout gets simpler or better.
>
> But in this case I think the 'designer' has made a flawed design...he has
> left out that all important
> VCC-VDD decoupeling capacitor. His circuit may work but I'll bet it would
> work better if
> it had a supply decoupeling cap, especially as he is using the VCC pin as a
> AC return point.
>
> kg4pid skrev:
>
> I just found this clock circuit, but I'm confused as to why the
> trimmer cap is connected to a positive voltage instead of ground. It
> is a different clock chip but the same principal. The DS1307 has an
> input for the backup battery so it doesn't need the diodes.
>
> http://www.winpicprog.co.uk/pic_tutorial_i2c_clock_board.htm
>
> Should I do the same with the DS1307?
>
> Max
> .
> --
> *******************************************
> VISIT MY HOME PAGE:
> LAST UPDATED: 23/08/2003
> *******************************************
> Regards
> Eirik Karlsen
>
Yes, and I didn't make it any better...VCC and VDD (Collector and Drain)
are in most cases both positive.
What I meant, and should have written, was VDD-GND (or was it VCC-VSS ?).
Lets just say supply Plus-Ground, that leaves little doubt.
Phil Seakins skrev:
>
> Even more confusion because the backup battery has been drawn in
> backwards (upside down). Personally I have a lot of trouble with the
> symbols - VDD and VSS, I can never remember which is which and to make
> it worse their meanings (polarities) are different depending on
> whether you are dealing with NMOS or PMOS or CMOS. I really wish the
> original convention of VCC and GND had stuck, without introducing all
> these fangled terms.
>
> On 1/4/09, *Eirik Karlsen* > > wrote:
>
> It doesn't matter, VDD is also AC ground, if things are done
> correctly.
> In many cases one can find tuning and timing capacitors connected to
> VCC when they in principal should have been connected to GND.
> Some designers do this to this as personal preference, or because
> it makes a cleaner looking
> schematic, or simply because the PCB layout gets simpler or better.
>
> But in this case I think the 'designer' has made a flawed
> design...he has left out that all important
> VCC-VDD decoupeling capacitor. His circuit may work but I'll bet
> it would work better if
> it had a supply decoupeling cap, especially as he is using the VCC
> pin as a AC return point.
>
> ecent Activity
>
> *
> 2
> New Members
> Visit Your Group
> Yahoo! News
>
> Odd News
> You won't believe
>
> it, but it's true
>
> Yahoo! Finance
>
> It's Now Personal
> Guides, news,
>
> advice & more.
>
> Sell Online
>
> Start selling with
> our award-winning
>
> e-commerce tools.
>
> .
>
>

--
*******************************************
VISIT MY HOME PAGE:

LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen