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.
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.
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; char ddate;
For more detail: A Simple Clock using DS1307 and PIC16F877A
We recommend EasyEDA for electronic circuit design.
From Schematic to PCB Production, Just Need One Tool
Free Circuit Design Software: learn to use Editor quickly and easily
Cheapest PCB: 10pcs 2-layers 10cm×10cm only $8.21, 3-day build time, 100% E-test
Current Project / Post can also be found using:
- ds1307 pic16f877a
- rtc ds1307 mikroc
- code i2c ds1307 en mikroc
- ds1307 interfacing with pic c code