Microcontroller › 8051 › RTC DS1307 interfacing with 8051 in C using I2C……. › hi nagalaxmi…..,try this
March 22, 2013 at 5:03 am
#9361
Participant
hi nagalaxmi…..,
try this code…. it is easy….
unsigned char x,y;
//hour
c=read_i2c(0xd0,0x02);
x= c & 0x0F;
x=x |’0′;
y= c & 0xF0;
y=y>>4;
y=y | ‘0’;
write_lcd(y);
write_lcd(x);
write_lcd(‘:’);