I have tested this code today, and it works well on a 28x1 (not simulated).
<code><pre><font size=2 face='Courier'>
symbol seconds = b0
symbol mins = b1
symbol hour = b2
symbol day = b3
symbol date = b4
symbol month = b5
symbol year = b6
symbol control = b7
; Example of how to use DS1307 Time Clock
; Note the data is sent/received in BCD format.
; Note that seconds, mins etc are variables that need
; defining e.g. symbol seconds = b0 etc.
' set DS1307 slave address
hi2csetup i2cmaster, %11010000, i2cslow, i2cbyte
'write time and date e.g. to 11:59:00 on Thurs 25/12/03
start_clock:
let seconds = $00' 00 Note all BCD format
let mins = $27' 59 Note all BCD format
let hour = $23' 11 Note all BCD format
let day = $02' 03 Note all BCD format
let date = $16' 25 Note all BCD format
let month = $07' 12 Note all BCD format
let year = $07' 03 Note all BCD format
let control = %00010000 ' Enable output at 1Hz
hi2cout 0,(seconds,mins,hour,day,date,month,year,control)
SerTxd("Date set",CR,LF )
</font></pre></code>
<code><pre><font size=2 face='Courier'>
symbol seconds = b0
symbol mins = b1
symbol hour = b2
symbol day = b3
symbol date = b4
symbol month = b5
symbol year = b6
symbol control = b7
hi2csetup i2cmaster,%11010000,i2cslow,i2cbyte
main:
hi2cin 0,(seconds,mins,hour,day,date,month,year)
bcdtoascii date, b12,b13
SerTxd(b12,b13,"/"
bcdtoascii month, b12,b13
SerTxd(b12,b13,"-"
bcdtoascii year, b12,b13
SerTxd("20",b12,b13," "," "
bcdtoascii hour, b12,b13
SerTxd(b12,b13,":"
bcdtoascii mins, b12,b13
SerTxd(b12,b13,":"
bcdtoascii seconds, b12,b13
SerTxd(b12,b13)
SerTxd(CR,LF )
pause 1000
goto main
</font></pre></code>