Using Maxim DS1307 Real Time Clock with Atmel AVR Microcontroller Using Atmega32

Building our own digital clock is one of the dreamed project by most of the hobbyist or anyone that want to learn or involve seriously in the embedded system world; the ability to integrate time, day and date to the embedded system is one of the important knowledge that should be known by any embedded system designer. Today’s technology makes life easier as all these capabilities has already built nicely inside the Maxim (Dallas) DS1307 Real Time Clock (RTC) chip. The DS1307 is capable to count accurately the second, minute, hour, day of the week, date of the month, month and year include the leap year until the year 2100; with its I2C (read as I squared C, Inter-Integrated Circuit) interface capabilities make this chip easily to be integrated with widely available microcontroller that has build in I2C peripheral such as Atmel AVR Mega families or Microchip PIC18 families microcontrollers.

Using Maxim DS1307 Real Time Clock with Atmel AVR Microcontroller Using Atmega32
In this project we will learn to use the Maxim DS1307 RTC and Atmel AVR ATMega168 microcontroller to build quite sophisticated digital clock that have these following features:

  1. Using 2×16 LCD (Hitachi HD44780U) to display the digital clock
  2. Displaying days of week, day of month, month and year
  3. Displaying hour (24 or 12 hour format), minute and second
  4. Displaying current room’s temperature in centigrade format
  5. Setup the clock using the UART (Universal Asynchronous Receive Transmit) to communicate with the Windows’s HyperTerminal application.

In order to achieve this goal we will use many of the AVR ATMega168 peripherals; this makes this digital clock project is a good learning tools to explore and use many of the ATMega168 microcontroller sophisticated peripherals at the same time. I would suggest you could read my previous blogs to understand the basic of how to use the LCD, ADC, PWM, I2C and UART Atmel AVR peripherals, before you continue with this tutorial:

  1. Using 2×16 LCD: AVR LCD Thermometer Using ADC and PWM Project
  2. UART Communication: Working with AVR microcontroller Communication Port Project
  3. I2C or TWI (Two Wire Interface): How to use I2C-bus on the Atmel AVR Microcontroller

The following is the list of hardware and software used in this project:

  1. AVRJazz Mega168 board from ermicro which base on the AVR ATmega168 microcontroller (board schema).
  2. JazzMate DS1307 Real Time Clock board from ermicro
  3. JazzMate 2576 5 volt switching power board from ermicro
  4. LCD hardware: one 2×16 LCD (Hitachi HD44780U), one 10K trimport, one TIP120 darlington transistor and one 4K7 resistor
  5. WinAVR for the GNU’s C compiler
  6. Atmel AVR Studio 4 for the coding and debugging environment.
  7. STK500 programmer from AVR Studio 4, using the AVRJazz Mega168 board STK500 v2.0 bootloader facility.

Schematic Using Maxim DS1307 Real Time Clock with Atmel AVR Microcontroller Using Atmega32
For more detail: Using Maxim DS1307 Real Time Clock with Atmel AVR Microcontroller Using Atmega32


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top