3
\$\begingroup\$

I did some research, and I found contradictory response on the web. I'm polling a DS1307 on an loop, with an Arduino, that takes about 20 ms to run, so basically I'm polling the I2C interface 50 times in a second. Is this affecting the time accuracy of the IC?

ADDITION I did a lot of testing and I2C wasn't causing any clock drift, my poor accuracy had another cause, see this question.

\$\endgroup\$
  • 1
    \$\begingroup\$ That is an interesting question, and it sounds like you already have the perfect setup to be able to run some experiments, such as comparing the deviation of the clock after 24 hours of operation with 50 Hz polling and without polling. \$\endgroup\$ – Kaz Apr 25 '13 at 14:49
  • \$\begingroup\$ @Kaz Is actually the experiment I'm doing, but you know 24 hour is long to go:) Eventually I will reply myself with the reults. \$\endgroup\$ – Felice Pollano Apr 25 '13 at 14:51
  • \$\begingroup\$ Do you have your I2C line on 100kHz? That's the max, but you might usually use a higher frequency. So just to check ;) \$\endgroup\$ – Keelan Apr 25 '13 at 14:59
  • \$\begingroup\$ 24 hours is too long for you to sit there waiting for the result. Hmm. I know, get a co-op student! \$\endgroup\$ – Kaz Apr 25 '13 at 15:42
7
\$\begingroup\$

It shouldn't. The DS1307's i2c timings are measured in Micro and Nano Seconds. 20ms intervals are nothing compared to that. As long as you give atleast 4.7 µs between I2C Stop and Start signals, you should be fine.

Additionally:

When reading or writing the time and date registers, secondary (user) buffers are used to prevent errors when the internal registers update. When reading the time and date registers, the user buffers are synchronized to the internal registers on any I2C START. The time information is read from these secondary registers while the clock continues to run. This eliminates the need to re-read the registers in case the internal registers update during a read. The divider chain is reset whenever the seconds register is written. Write transfers occur on the I2C acknowledge from the DS1307. Once the divider chain is reset, to avoid rollover issues, the remaining time and date registers must be written within one second.

Considering that Dallas/Maxim doesn't list a minimum poll time below that would suggest you are fine.

But a question, why poll it so often?

\$\endgroup\$
2
\$\begingroup\$

It shouldn't, provided that noise from the I2C or a badly decoupled power supply doesn't affect the internal oscillator or counter.

\$\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.