Mel,
I've downloaded a fresh copy of the code from http://www.melabs.com/resources/samp...ted/MN1307.txt
The only things I've changed are making PORTA all input, PORTB output, the LCD to work on PORTB and the config setting s so it compiles on an 16F877A. - all the code that handles the setup of the clock is unchanged. I have all LEDS turned off so there is nothing else connected to either the RTC lines or switch inputs. RA4,5 and 6 are tied high via pull-up resistors, with switch's to gnd when pressed.
Code compiles and loads into PIC. time is shown on line 1 Hrs:min:sec, a date is shown on line two (which was the date set using a very basic example found on the web that simply writes values in a "string" to the device eg I2CWRITE SDA,SCL,$D0,$00,[$00,$00,$19,$7,$14,$2,$10,$90] )
All seems as it should, however pressing RA5 the display changes to "SET MODE :" with the 12 / 24 HR constantly over-writing itself. Pressing RA4, 5 or 6 has no effect, and if left doesn't auto switch back to display the clock.
Code attached
Any ideas ?





Bookmarks