Digital clock " DS1307 RTC" with PIC16F877A microcontroller and I2C
Digital clock " DS1307 RTC" with PIC16F877A microcontroller and I2C: #include <xc.h> // Include XC8 compiler header file #include "config.h" // Include configuration header file specific to the project #define _XTAL_FREQ 4000000 // Define the crystal frequency for delay calculation #define RS PORTBbits.RB0 // Define LCD RS pin #define RW PORTBbits.RB1 // Define LCD RW pin #define EN PORTBbits.RB2 // Define LCD EN pin #define delay for(i=0;i<1000;i++) // Define delay macro #define ds_adress 0xD0 // Define DS1307 I2C address #define second 0x00 // Define DS1307 register addresses #define minute 0x01 #define hour 0x02 #define day 0x03 #define date 0x04 #define month 0x05 #define year 0x06 #define control_reg 0x07 void ds_write(char _second, char _minute, char _hour, char _day, char _date, c
Comments
Post a Comment