A Simple Clock using DS1307 and PIC16F877A




Even I have posted about “DS1307 + PIC16F877A“, I didn’t have chance to make a real prototype of the clock. I have done only on the simulation software.

Simple Clock using DS1307 and PIC16F877A

Today, I have received a comment about that post. ah_bear followed my code and schematic on that post but the clock didn’t work. This is because the code on that post is for reading time from DS1307 so there must be some values in the DS1307 before you can read. The solution is simple. Just place setting time codes before reading codes.

This time, I have made a real prototype to confirm that it’s working. There is no setting buttons. If you want to make a real usable clock you have to implement the button interfaces (I may make one and post it here). The photo of my working prototype is featured below. Please check out my flikr at http://flickr.com/photos/punkky/ for more photos.

Simple Clock using DS1307 and PIC16F877A schematic

The source code:

//Sample code for
//DS1307 RTC Interfacing with PIC16F877A
[email protected]
//Compiler: mikroC 8.0.0
//http://picnote.blogspot.com
//05/01/2009
//Use with your own risk

unsigned short read_ds1307(unsigned short address );
void write_ds1307(unsigned short address,unsigned short w_data);
unsigned short sec;
unsigned short minute;
unsigned short hour;
unsigned short day;
unsigned short date;
unsigned short month;
unsigned short year;
unsigned short data;
char time[9];
char ddate[11];

 

For more detail: A Simple Clock using DS1307 and PIC16F877A




Current Project / Post can also be found using:

  • ds1307 with pic16f877a
  • RTC digital alarm clock with ds1306 using pic controller
  • i2c mikroc 16f877
  • mikroc i2c simple

Leave a Comment

*
= 3 + 5

Read previous post:
6 Digits LED 7-Segment Multiplexing
6 Digits LED 7-Segment Multiplexing using PIC16F627A

In the post 'LED 7-Segment Multiplexing', I have explained about the concept and benefits of multiplexing. Multiplexing implementation is very...

Close
Scroll to top