-1
\$\begingroup\$

I've got a TinyRTC board with a DS1307 on it connected to an Arduino. Setting the time and reading is no problem (using the DS1037 Arduino lib). Weird thing though is that when I disconnect the power (from the Arduino) the time seems to be stuck in time, say I disconnect power at 01:23 and reconnect 30 minutes later the time will still be 01:23 (also tried waiting to reconnect power till the next day, still the same time). What can be wrong? (already replaced the backup battery with a fresh 3V lithium cell)

\$\endgroup\$
  • \$\begingroup\$ Please check your crystal. \$\endgroup\$ – diverger Nov 17 '14 at 5:46
  • \$\begingroup\$ What diverger is hinting at and would be worth including in the question is does the clock continue counting up if you don't remove power? There are also some setting that can disable the oscillator so including the init code would help getting a good answer. \$\endgroup\$ – PeterJ Nov 17 '14 at 9:08
  • \$\begingroup\$ @PeterJ - as far as I understand the datasheet, you can only disable or enable the square wave output, but not the oscillator. \$\endgroup\$ – Kitana Nov 17 '14 at 9:16
  • \$\begingroup\$ @Kitana, just had a quick look and it looks like "clock halt" / CH is what I was thinking off. It defaults to off so might be a good possibility if the seconds register isn't programmed. But would be good to know from Heiko if does count up while power is applied the whole time and any code involved. \$\endgroup\$ – PeterJ Nov 17 '14 at 9:32
  • \$\begingroup\$ @PeterJ, you where right - crazy engineers hiding control bits in data values - i haven't remarked that. \$\endgroup\$ – Kitana Nov 17 '14 at 9:46
-1
\$\begingroup\$

Suppose the TinyRTC board was broken... replaced it with another one and everything worked as expected.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.