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
EasyEDA: Ideas for Circuit Design, Innovation for Electronics Access
Free Circuit Design: Schematic – Simulation – PCB Layout – Gerber Viewer
Cheapest PCB Prototype: Only $2 for 10pcs 10×10cm PCBs, 24 hours Quick Turn, DHL Delivery in 3 Days
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