3

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.

Felice Pollano
  • 853
  • 9
  • 20
  • 1
    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. – Kaz Apr 25 '13 at 14:49
  • @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. – Felice Pollano Apr 25 '13 at 14:51
  • Do you have your I2C line on 100kHz? That's the max, but you might usually use a higher frequency. So just to check ;) –  Apr 25 '13 at 14:59
  • 24 hours is too long for you to sit there waiting for the result. Hmm. I know, get a co-op student! – Kaz Apr 25 '13 at 15:42

2 Answers2

7

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?

Passerby
  • 72,580
  • 7
  • 90
  • 202
2

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

pjc50
  • 46,540
  • 4
  • 64
  • 126