That clock wont run

Hi all,

im working on a simple RTC 1307, like this one u can see in many tutorials. I just want a clock that works a 'tick' more precise than the internal Arduino Uno counter (@atmega328P) but i wont get it. Sitting for the whole day and every time i try a new way its the same, that clock wont run.

I followed that tutorial ( http://www.glacialwanderer.com/hobbyrobotics/?p=12 ) but my clock tells everytime i ask "45:165:85 165/165/165"

Its getting late and im out of ideas, maybe someone nice has a good idea or a similar problem.

P.S. I dont have the Shield RTC, but a DS1307 with 32K Crystal on a breadboard,connected on A4(SDA)/A5(SCL)

Greetings, Mosfett

MosFett: I just want a clock that works a 'tick' more precise than the internal Arduino Uno counter

"45:165:85 165/165/165"

I understand the DS1307 is no more accurate than Arduino's timer, just more convenient. The DS3231 is a lot more accurate and costs only a couple of dollars more. Looking at the drawing, I have never seen pullup resistors on the SDA/SCL lines like that before, and I suspect Ribble doesn't know what he is doing. Having said that, the code appears to be similar to what I use from these guys

http://bildr.org/2011/03/ds1307-arduino/

who do know what they are doing.

I believe the 165s signal a bad, improper, or non-existent connection. Removing the resistors may fix that, otherwise check the rest of the wiring.

Thx for reply, i removed the resistors after i figured out that the I2C uses the internal pullUps but wont change, ill have a look to your Link

Hey :D at least the code from your side shows "4/17/8 7:3:45" and not that crap from hours ago xD But the clocktime stands still, so sad, no second will move xD At least it seems to be connected, unpinning a cable gets the already known "165/165/165 45:165:165" back on the console ;)

MosFett: xD

You post is unintelligible but I assume the wiring is kosher, which I thought might be the real problem. Note that in the link there are TWO programmes - one to set the time, and the other to read it.

Hehe, i guess my english isnt the best anymore^^, greetings from germany! Nope wiring is not the problem, i fear that the IC is damaged. Setting the clock with the script below on your site seems to work, i thougt the script #1 reads the clock every second and shows time & date on the console, that one fails, cause the seconds wont raise.

Btw. DS3231 is on the way, thanks for the hint ;)

OK. I have not used my DS3231 yet. I believe it uses the same code as the DS1307.

A DS1307 should be more accurate (20-30ppm) than most Arduino system clocks since they mostly use ceramic resonators (~5000ppm). But yes a DS3231 is better still (2ppm).

The Arduino's internal pullup resistors are technically too large for the I2C bus, even though they may work fine much of the time. 4.7K-10K is better if the bus runs at 100kHz (the default) and 2.2K is appropriate for 400kHz bus speed. There is no harm in using the smaller values; my habit is to use 2.2K regardless of bus speed unless I have a specific reason not to.

The circuit at http://www.glacialwanderer.com/hobbyrobotics/?p=12 is badly drawn but correct ;) except that the DS1307 should have a 100nF bypass capacitor connected from its Vcc (5v) pin (as close as possible to the chip) to ground.

Nah ok, i really think that one is damaged. Next week ill get the DS3231 running i hope :)

I breadboarded a DS1307 once, it worked fine.

@John,
maybe its the breadboard, but anyway and especially because the 1307 isnt THAT way precise, ill rebuild with that DS3231. That one comes on a mini-shield and should do fine.

Hey all,

got the DS3231 Module, now my clock is working fine, and i made peace with the I²C Bus :sweat_smile: Do u know that it comes along with a temperature register ontop :D ?! Im amazed ;)

Thanks for your Comments

MosFett: Hey all,

got the DS3231 Module, now my clock is working fine, and i made peace with the I²C Bus :sweat_smile: Do u know that it comes along with a temperature register ontop :D ?! Im amazed ;)

Thanks for your Comments

The DS3231 is accurate because it has a temperature-compensated crystal oscillator. It continually adjusts the oscillator frequency depending on the ambient temperature, so it needs a temperature sensor to do that. As a bonus, the temperature can be read out. It's not a terribly accurate sensor (±3°C or something like that) but better than nothing. Still, it's good enough to keep the time very close.

Hello i have a Question on the 3231 rtc haves 2 extrea pins a 32k pin and a sqw pin do they need to be connected?

Hello i have a Question on the 3231 rtc haves 2 extrea pins a 32k pin and a sqw pin do they need to be connected?

No.

josephchrzempiec: Hello i have a Question on the 3231 rtc haves 2 extrea pins a 32k pin and a sqw pin do they need to be connected?

Only if square waves (SQW) or a 32.768kHz signal (32K) is needed.

thank you i didn’t know what them 2 pins are for.

Hey, there is no conncection needed