Perhaps this will help. Note input time number in hex --
hserin [hex2 wb1]
Clock_set:
GOSUB GET_TIME
hserout [ "0 second ",hex sec,13,10]
hserout [ "1 minute ",hex minute,13,10]
hserout [ "2 hour ",hex hour,13,10]
hserout [ "3 day ",hex day,13,10]
hserout [ "4 date ",hex date,13,10]
hserout [ "5 month ",hex month,13,10]
hserout [ "6 year ",hex year,13,10]
hserout [ "7 reset ",13,10]
hserout [ "8 exit ",13,10]
hserin [dec1 wb]
IF wb = 7 THEN reset
if wb > 7 then keypad
hserout [10,13,DEC wb," value? "]
hserin [hex2 wb1]
HSEROUT [13,10,10]
I2Cwrite datapin, clockpin, $d0, wb, [wb1] ' Set Clock
goto clock_set
RESET:
FOR smooth = 7 TO 0 ' Clear Clock DS1307 clock reset and start crystal
I2Cwrite datapin, clockpin, $d0, smooth, [0] ' Run when backup battery replacement
NEXT
Bookmarks