Spanish Italian
17454 Users    

DS1307 - Serial, I2C Real-Time Clock

  Download PDF version of the Article

The DS1307 serial real-time clock (RTC) is a lowpower, full binary-coded decimal (BCD) clock/calendar plus 56 bytes of NV SRAM. Address and data are transferred serially through an I2C, bidirectional bus. The clock/calendar provides seconds, minutes, hours, day, date, month, and year information. The end of the month date is automatically adjusted for months with fewer than 31 days, including corrections for leap year. The clock operates in either the 24-hour or 12- hour format with AM/PM indicator. The DS1307 has a built-in power-sense circuit that detects power failures and automatically switches to the backup supply. Timekeeping operation continues while the part operates from the backup supply.

The DS1307 uses an external 32.768kHz crystal. The oscillator circuit does not require any external resistors or capacitors to operate.

The DS1307 supports the I2C protocol. A device that sends data onto the bus is defined as a transmitter and a device receiving data as a receiver. The device that controls the message is called a master. The devices that are controlled by the master are referred to as slaves. The bus must be controlled by a master device that generates the serial clock (SCL), controls the bus access, and generates the START and STOP conditions. The DS1307 operates as a slave on the I2C bus.

Read and download: DS1307 - Serial, I2C Real-Time Clock

DS1307

This component is really very interesting. As stated in the article, if a power failure is detected it automatically switches on the backup battery (usually it is a lithium battery as those used in PCs to store the BIOS and time configuration). Also, the I2C interface is inhibited if the input voltage drops below 1.25 x Vbat, preventing corruption of time data due to bad or incomplete write operations performed through the serial interface.
I found an interesting link on the web:
http://www.best-microcontroller-projects.com/real-time-clock-ic.html
it explains how to build a precise desktop clock using a PIC 16F88, a DS1307, and a four digit 7 segments display. Schematics and code explanation are provided.

TTL clock

The link you provided broke a smile on my face, solvati.
The 7 segment display clock was one of the first projects one of my friends went through. Although the late 1990s, he did it with some TTLs because he did not want to throw them away. Current consumption was just horrible!

Later in the early 2000s he made a new one around a CPLD: much better this time.

None of them, however had a RTC chip...

Cristian

I couldn't have asked for

I couldn't have asked for more, you explained everything in a perfectly understandable way. The company I work in needs a time and attendance program that would allow more transparent and more accurate time sheets. Reading this insightful article helped me realize that having a time clock of our own is not that difficult after all.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
15 + 3 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Who's new

  • fernand
  • Ligrock
  • paolo_0665
  • chanuei
  • JM
  • samsilva77
  • araghube
  • stoll
  • mt
  • orionkw

Who's online

There are currently 0 users and 59 guests online.