DS1302 - timekeeping chip runs slow...
![tommy](https://forums.parallax.com/uploads/userpics/105/n0M25GA5O4VDU.jpg)
... Hello.· I go away to see the world in my boss' advertising truck, and this trip had me in Denver for 32 days...·· and my SX-powered, remote-control, automatic vertical blinds (that open at 9:30 am and close at dusk) also have a cookoo clock-feature that beeps the time every hour.
... having set the time on the morning I left, I then noted when I came home, the clock was exactly three minutes slow (compared to a faithful clock-radio that I haven't reset in ten years)...··and now·I have an semi-accurate reading of five and a half seconds a day.
... Is there something wrong with the DS1302 ??? --- it was my first and only and is socketed --- might the 32768 hz crystal be different from the other twenty in the package I bought ???
·![attachment.php?attachmentid=53700](http://forums.parallax.com/attachment.php?attachmentid=53700)
... or should I just program an adjustment into the SX-28 (the easiest solution).· On my homemade circuit board, I did extend a ground-leg around the crystal as I had seen in articles and schematics.
thanks.· tommy
Post Edited (tommy) : 5/19/2008 6:48:01 PM GMT
... having set the time on the morning I left, I then noted when I came home, the clock was exactly three minutes slow (compared to a faithful clock-radio that I haven't reset in ten years)...··and now·I have an semi-accurate reading of five and a half seconds a day.
... Is there something wrong with the DS1302 ??? --- it was my first and only and is socketed --- might the 32768 hz crystal be different from the other twenty in the package I bought ???
·
... or should I just program an adjustment into the SX-28 (the easiest solution).· On my homemade circuit board, I did extend a ground-leg around the crystal as I had seen in articles and schematics.
thanks.· tommy
Post Edited (tommy) : 5/19/2008 6:48:01 PM GMT
bmp
![](/plugins/FileUpload/images/file.png)
28K
Comments
tommy
I'm running the DS1302 in an IC socket and have been for quite a while now with extreme accuracy. The crystal is from Parallax, and is soldered very close to the pins of the socket with short leads on the crystal itself. Also make sure that you clean the solder flux from the solder joints of these pins as the flux will cause timing issues. There have been a few discussions on this forum about the crystal soldering·technique, but I can't remember where they were or who posted them. Another thing that I did on my board was to run the ground trace under the DS1302 rather than around the crystal. I dont know if this would make a difference or not.
Twisted Pair....
By the way Tommy, even though your schematics are not·showing any support hardware, I assume that you are using them ?
Post Edited (Twisted Pair) : 5/19/2008 10:49:04 PM GMT
There is also an AppNote from Dallas/Maxim regarding the importance of following the crystal placement and layout. There are also different capacitive load values for crystals and the DS1302 requires a specific one. If you got it from us it is the correct one, however I have seen where people have ordered the wrong one and had issues.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
... "different capacitive load values" is a new term for me.· I just went for the 32,768 khz value quite a while ago,·from DigiKey,·and assumed they were all the same...··· It says 12.5 pf on the package.· Now is the time to learn, as I'm building a new board to add a large 5V,·capacitor on the other DS1302 voltage pin (5) to accomodate the occasional power failure...
... "support hardware" ??? -- if you mean the capacitors on each side of the 7805 power supply, and the one right at the head of each IC ?? -- yes.· I copy the values from things I see and read.· And the power and the ground leads take the same general paths to get to each component...· If you mean something else, well I guess I could learn some more...
... I'll be ordering a couple of·crystals from Parallax if I see a different capacitive load value written there somewhere...·· in the meantime, I could program a 2:00am jump of five seconds per day, and every eight days an additional five seconds...
... thank you for now, I'll keep looking here...· tommy
Here is where the data sheet is at this link
http://www.parallax.com/Portals/0/Downloads/docs/prod/datast/ds1302.pdf
·This·is·off of the data sheet for DS1302
CRYSTAL SELECTION·
A 32.768 kHz crystal can be directly connected to the
DS1302 via pins 2 and 3 (X1, X2). The crystal selected
for use should have a specified load capacitance (CL) of
6 pF. For more information on crystal selection and
crystal layout consideration, please consult Application
Note 58, “Crystal Considerations with Dallas Real Time
Clocks”.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any·
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 5/20/2008 4:20:19 PM GMT
·
... it was nice to have the clock on board solely for its non-volatile memory area, where I keep a copy of the adjustable opening time and a "darkness-value" for the RC-time circuit to determine 'dusk'.
... should I want an accurate timepiece I'll monitor the 60-cycle current somehow - say ! ! ! -·
'bye for now.· tommy