'DS3231
'Can anyone tell me why this code does not work?
settime:
sda var portb.6
scl var portb.5
cntrl CON $10
rtc CON %11010000
SecReg CON $00
hours = $16
minutes = $40
seconds = $00
month = $01
date = $04
year = $16
day = $02
I2cwrite sda,scl, rtc, $D0, $00,[seconds,minutes,hours,day,date,month,year,cntrl]
return
'This line works fine to read from the DS3231
I2CRead sda,scl, rtc, secreg,[seconds,minutes,hours,day,date,month,year]
Bookmarks