DS1302 Losing Time
Zeus
Posts: 79
Hello All,
I have a DS1302 that I am using in a clock project and I have a chronic problem with it losing time. I know that there were/are issues with time loss while on battery backup however this is not my problem as I have not gotten to backing up the chip yet.
I have been running the clock for three days now and for the first few days it was spot on. No it seems to be losing 5 minutes a day.
I have mounted the crystal as close as possible on my breadboard.
Thanks in advance
Zeus
I have a DS1302 that I am using in a clock project and I have a chronic problem with it losing time. I know that there were/are issues with time loss while on battery backup however this is not my problem as I have not gotten to backing up the chip yet.
I have been running the clock for three days now and for the first few days it was spot on. No it seems to be losing 5 minutes a day.
I have mounted the crystal as close as possible on my breadboard.
Thanks in advance
Zeus
Comments
Double check that you have the absolutely correct crystal (for speed and capacitance).
If the crystal is good, it's probably the breadboard introducing too much capicitance and noise into the crystal leads and throwing the time off. I would solder the crystal right to the pins of the DS1302 and try it that way (or sometimes you can force the leads in with the pins into a socket, but that's a one way trip and will probably trash the socket and very occasionally the crystal).
Good grounding is important and no noise around the chip (route your power and signal wires elsewhere on the breadboard). A decoupling cap (.1uf or so) on the Vcc and Vss of the chip is good too, if you don't have one already.
Zoot,
I will try the capacitor and let you know how it goes.
CalMariner,
I will see if I can post a picture tomorrow. It is nothing pretty but I made sure to mount the crystal as close as possible to the DS1302, if that is what you were wondering.
Zeus
The DS1302 requires a crystal with a load capacitance of 6pF. Any more/less and the clock runs slower/faster and affects accuracy. Using a breadboard automatically adds capacitance to the circuits resulting in losing time. Once your circuit is moved to a PCB you can prevent interference of the crystal by following the guidelines in the following AppNote, which discusses this very issue.
http://www.maxim-ic.com/app-notes/index.mvp/id/58
I was surprised to see that myself.
@Zeus - one thing you could do prior to making a PCB with all the appnote related techniques would be to lift the X1 and X2 pins of the DS1302 and carefully solder the crystal to them. That would result in the least parasitic capacitance possible.
Then you could put the socket into the breadboard. If you used an 8-DIP IC socket, the idea is to insert the crystal leads into the socket at the same time as the chip pins. To be honest, at that point it might be better to go to Radio Shack or the like and get a $10 soldering iron and just solder the crystal to the chip. Then the chip could be put into a socket, or a breadboard, etc. and not suffer from capacitance on the crystal introduced by the circuit construction itself.
Once I get it soldered I most likely will pot it to the I.C. with epoxy.
Thanks... Zeus