In gathering examples to test some hardware and learn how to PbP works (or not in my case) I came across Mel's code for a real time clock using a DS1307.
The only changes I've made is to reflect the LCD on port B rather than port A, changed the three buttons to RA4,RA5 and RA6 (because port B is used by the LCD) and used pull up resistors as the weak pulls didn't work.
The code compiles and loads in to an 16F877A and runs fine, displaying the time on the first line, and date on the second line. However pressing RA5 (set /memorise button) results in the SET MODE being displayed with 12HR / 24HR alternating very quickly. Pressing any of the keys (RA4/5/6) has no affect and it's not possible to set any option. I have to reset the PIC to get out of the setup mode.
I've attached the file rather than post the code in the body of this thread. Hopefully someone can point me in the right direction
Bookmarks