Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

DS1307 Read Vs Time Error

Status
Not open for further replies.

Suraj143

Active Member
Guys I have made a clock using the DS1307 & PIC16F628A software based I2C. The clock is working.

But I'm reading the DS1307 every second & update the display. I have not used the SQW pin & I do not want to use that.

Most experts say frequently reading (like every 1sec) the DS1307 will slow down the clock.

Is this true?How often do you read in your designed clocks?
 
If you think about this for a moment, you will realise that if it were to slow down the RTC device every time you were reading its registers, you would be just as well performing the RTC function inside a loop in your Micro. The whole point of using an RTC chip is that your reading of the values does not interfere with the RTC device keeping time.

Read the device as often as you like. Oh and read the datasheet for the DS1307 again while you are at it :)

If you have a timekeeping error, check that your crystal is running at 32.768Khz and the frequency is not being pulled by poor board layout or a bad connection. Breadboard for example, is notorious for this because the wires from the crystal are so thin that they barely make contact.
 
Most experts say frequently reading (like every 1sec) the DS1307 will slow down the clock.
Who are these experts!!! As tunewolf said, the crystal has to be extremely close to the chip with a good connection.
 
I built a heating controller for home with a DS1307 and it has been running now for 9 years. The code reads the DS1307 several times a second and it has never 'lost' time. In fact it gains about 5 minutes over 6 months. (I only reset it when I'm changing from BST to GMT or back) The circuit is built on solder pad-board so the crystal connections don't exactly conform to best practice :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top