I am working on a timer that will turn on at high tide.
I'm just getting started with this RTC and have been experimenting with Melanie's MN1307 -- It is very helpful & explains alot - but I am having some problems & I hope some one who has use this sample program may be able to shed some light.
I have wired this up & compiled the program with additional I2C write line to get the 1307 initialised. SetupPreset now looks like this:
SetupPreset:
RTCSec=$00 ' Seconds preset to 00
RTCMin=$15 ' Minutes preset to 15
RTCHour=$13 ' Hours preset to 13'00
RTCWDay=$01 ' Weekday preset to 01
RTCDay=$12 ' Day preset 12
RTCMonth=$06 ' Months preset to June
RTCYear=$02 ' Year preset to 2002
RTCCtrl=$10 ' Control preset to output 1 second 'Tick' on SQWpin
I2CWrite SDApin,SCLpin,$D0,$00,[RTCSec,RTCMin,RTCHour,RTCWDay,RTCDay,RTCMonth,RTCY ear,RTCCtrl]
Pause 1000
Return
The display shows the 12 June 2002 defalut time OK
I'm having a problem with the setup loop - I can't get it to advance from the 12 24 hour set mode screen
all three buttons toggle between the 12 & 24
after the 20 secs delay it goes back to the time display as it should.
I'm not sure if I have a hardware or software problem - All three switches seem to be OK
Any suggestions will be appreciated.
Thanks
Bookmarks