Shop OBEX P1 Docs P2 Docs Learn Events
DS1307 - Time running too behind? — Parallax Forums

DS1307 - Time running too behind?

John A. ZoidbergJohn A. Zoidberg Posts: 514
edited 2011-03-20 21:28 in General Discussion
Hello there,

I'm ready to finish prototyping my project on the breadboard - but I bumped into one funny issue.

I have an RTC inside the project and when I disconnect the main supply, the RTC keeps the time, but it's like minutes and then hours behind afterwards.

I have a new CR2032, so it isn't the battery running out, and rest of the connections aren't short circuited.

By the way, before that it seems to keep the time well and good, but not after yesterday.

Should I even need to transfer them to the real circuit board? Because I heard that the breadboard isn't too friendly for the DS1307 and the crystal.

Thanks for the opinions. :)

Comments

  • bee_manbee_man Posts: 109
    edited 2011-03-19 04:40
    I usually solder the crystal directly to pins 1 & 2 when bread boarding the DS1307 that way you eliminate long connections that will affect the crystal. Are you using a 12.5pf crystal? Any other signal lines close to the crystal? The crystal ideally should be close to the IC and secured to a ground plane below. I would also double check your battery voltage when the circuit is off.
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2011-03-19 05:27
    Double checked the battery - it's a fresh 3.3V.

    Unfortunately I do not have much information about the brand of the watch crystal. Currently, ground lines from the LCD panel and the LM35 are nearby the crystal.

    I will solder the thing on the veroboard if possible. :)

    edit: Previously, the battery is on another breadboard due to lack of space on the main breadboard (microcontroller + LCD + ds1307).

    After much squeezing back the battery on the main breadboard, (don't ask me how I do it, it's like a nasty and hasty brain surgery!) it retains the time well and good. But I had to test it for an hour to see whether it's acting up or not.
  • RickBRickB Posts: 395
    edited 2011-03-20 19:51
    Keep in mind that the typical watch crystal wants to be near body temperature to stay on frequency.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-03-20 21:28
    I've found RTCs tend to glitch when switching power, etc. especially if they have leads hanging out in the breeze. They seem susceptible to EMI wherever they can find it, so for breadboarding I will solder the RTC and crystal and all supporting components for the RTC to its own little board then plug that little board into the breadboard to help minimize the interference. The insidious thing about RTCs glitching like that is that it's not always obvious: sometimes they can skip an hour or a day or a year and yet keep on running like nothing else ever happened. Then you download your data a month later and only then do you discover that all those dairy cows you were monitoring somehow traveled faster than the speed of light.
Sign In or Register to comment.