Dallas DS1302 RTC problem

Started by mrrmckenzie June 26, 2005
I have 4 new DS1302 chips and 4 new 32khz watch crystals intending to
make a persistent RTC for my BX35 project. Problem is that after
finally connecting all the stuff together on a breadboard and
programming up a simple test routine I do not get healthy results. One
of the DS2302's will count up the seconds register but appears to take
from 4 to 8 (variable) real seconds for each increment. The other 3
chips simply do not increment at all. I have tried all of my crystals
without any apparent variances. The chip registers are read/writeable
and work. Am I right in suspecting that the Xtals I have are not
suitable for the simple connection between pins 2 and 3 of the DS1302's
ie could using xtals with load capacitance of 12.5pf instead of 6pf
generate a weaker signal that may not be counted correctly or even not
detected at all by the DS1302's (I am not sure of the load cap of my
Xtals)

regards
Macka


I had the same problem with the 1302 and it was my code, not the xtal or
the chip. If I recall, i had not set one of the registers correctly and
I got variable results.

mrrmckenzie wrote:

> I have 4 new DS1302 chips and 4 new 32khz watch crystals intending to
> make a persistent RTC for my BX35 project. Problem is that after
> finally connecting all the stuff together on a breadboard and
> programming up a simple test routine I do not get healthy results. One
> of the DS2302's will count up the seconds register but appears to take
> from 4 to 8 (variable) real seconds for each increment. The other 3
> chips simply do not increment at all. I have tried all of my crystals
> without any apparent variances. The chip registers are read/writeable
> and work. Am I right in suspecting that the Xtals I have are not
> suitable for the simple connection between pins 2 and 3 of the DS1302's
> ie could using xtals with load capacitance of 12.5pf instead of 6pf
> generate a weaker signal that may not be counted correctly or even not
> detected at all by the DS1302's (I am not sure of the load cap of my
> Xtals)
>
> regards
> Macka >
>
> >. >
>




> ... appears to take from 4 to 8 [] real seconds for each increment...

Maxim/Dallas has an appnote for RTC issues:
http://pdfserv.maxim-ic.com/en/an/app58.pdf

"The following are the most common scenarios that cause a crystal-based
RTC to run slow: 1) Overshoots on RTC input pins. It is possible to
cause a RTC to run slow by periodically stopping the oscillator. This
can be inadvertently accomplished by noisy input signals..."

Breadboard noise? Improper power?

> ... 12.5pf vs. 6pf...

Load capacity cannot affect the clock rate to the degree you're seeing
unless you got really difficult crystals that just don't want to start
reliably; that's unlikely so I suspect it's not that.

Programming? Tom
Tom Becker
--... ...--
GTBecker@GTBe... www.RighTime.com
The RighTime Clock Company, Inc., Cape Coral, Florida USA
+1239 540 5700


Thanks for the response Neil, Tom. As I said the program is quite
simple..... setting the control register to enable writes, put a
value into the seconds register and then loop every couple of seconds
to read the seconds register to see what is happening. It is
accepting my initial seconds value and begins very slowly
incrementing from there. I have enabled the trickle charge circuit
for max charge and can confirm the circuit is charging the super cap
(.047mf) to about 3.8v but the clock doesn't appear to even increment
when the BX35 is powered down but with the backup capacitor charged
and connected to the one chip that is even willing to count. My
breadboard has only the clock chip and the Xtal mounted on it and
some jumper wires from the BX development board to the breadboard
(Vcc,Gnd,CS,I/O and SCLK)

Macka

--- In basicx@basi..., "Tom Becker" <gtbecker@r...> wrote:
> > ... appears to take from 4 to 8 [] real seconds for each
increment...
>
> Maxim/Dallas has an appnote for RTC issues:
> http://pdfserv.maxim-ic.com/en/an/app58.pdf
>
> "The following are the most common scenarios that cause a crystal-
based
> RTC to run slow: 1) Overshoots on RTC input pins. It is possible to
> cause a RTC to run slow by periodically stopping the oscillator.
This
> can be inadvertently accomplished by noisy input signals..."
>
> Breadboard noise? Improper power?
>
> > ... 12.5pf vs. 6pf...
>
> Load capacity cannot affect the clock rate to the degree you're
seeing
> unless you got really difficult crystals that just don't want to
start
> reliably; that's unlikely so I suspect it's not that.
>
> Programming? > Tom >
> Tom Becker
> --... ...--
> GTBecker@R... www.RighTime.com
> The RighTime Clock Company, Inc., Cape Coral, Florida USA
> +1239 540 5700