5

I have a TinyRTC I2C clock in one of my Arduino projects, and it works most of the time. But occasionally, it will report the time as 165 hours, 85 minutes and 25 seconds (165:85:25) for a couple of seconds, then go back to the correct time.

I think this has got something to do with a fairly complicated I2C bus that I'm running: it has 12 devices connected to it (the clock, an LCD and 10 BlinkM LED programmable lights).

Here's what I've tried to debug, to no avail:

  • Replaced the RTC and battery
  • Replaced I2C pullup resistors
  • Redid the I2C wiring
  • Checked current draw of my project (.2A) and made sure the power supply can handle that (it can)
  • Used 3 different power supplies in case I was getting noise

I think this is something to do with the I2C bus... the clock works fine when nothing much else is happening on the bus, but as soon as there's lots of activity (LEDs being sent messages, or perhaps other things) it starts reporting the time as 165:85:25).

Any idea how I could (a) isolate the cause of this problem; (b) get right to implementing a solution?

  • arduino.cc/en/Reference/WireEndTransmission Did you try the stop parameter and/or check error conditions that are returned? Hard to tell what's wrong without circuit or code. – jippie Aug 31 '14 at 19:37
  • 1
    What code/library did you use? What was the expected time for 165:85:25? – Gerben Sep 1 '14 at 16:00
  • How large are your pull-ups on the bus? – user3835 Sep 3 '14 at 13:14
  • It might be an error code for I2C or it could be a status report from the TINY RTC. So how are you sure that it is responding with the current time? – Treesrule14 Sep 3 '14 at 16:18
  • @jippie - Your link was useful... am going to try slowing down the I2C bus in case there's a problem communicating with so many devices. – David Sep 7 '14 at 22:44
1

Such intermittent issue looks to me a hardware signal integrity problem, specifically around the I2C bus RTC chip. Did you experience any problem from any other device on the same I2C bus (e.g. when all the LEDs are on)? If not, then check on the noise level on RTC chip power and GND. Also, the I2C spec has limit on the bus capacitance load as max as 400 pF. When there are too many I2C device loads on the same bus, the bus may become vulnerable to the system noise.

Debug Suggestion: To narrow down if it is I2C load issue, add an I2C bus driver chip between the main Arduino board and your peripheral. For example, P82B96 from TI. See the spec here. http://www.ti.com/lit/ds/symlink/p82b96.pdf

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.