DS1307 RTC with PIC + Hardware i2c

DS1307 RTC with PIC header image

In this DS1307 RTC with PIC + Hardware i2c project, the microcontroller reads time and date from the DS1307 module and displays it on the LCD. The i2c_init() function, configures the I2C hardware as below figure.

Input frequency = 4MHz
Frequency = 25KHz
Mode = Master

The rtc_get_time() function, gets time from the DS1307 and when the value becomes greater than 59 (the first time DS1307 powered on), the time by default sets to 12:00:00. And after these instructions, the time will be displayed on the LCD. Note that user can add additional buttons for setting the time and date for easier user experience.

download the project here.
Also, don’t forget to checkout the same project with software oriented i2c here.

Leave a Reply

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