I don't want to make a nuisance of myself in these forums ( fora ? ), but I find the manuals too difficult for a beginner to understand, and as well, I'm amazed at the information that's out there with the gurus willing to help people like me.
I've learned how to show a file, and that's what I'm doing.
It shows what I do to read the time on a DS3232. It reads the initial values I set to begin with, but I can't get it to access the time at any other time after the time I set to begin with. I am quite ready to believe I have missed some technique, and I'd be very pleased to be shown how to do it. What do I do ?
Another difficulty is where I convert BCD to DECIMAL, towards the end of the program. Why does the conversion need the # sign? I don't seem to be able to use the value to compare the clock's times with a decimal value of mine.
Thanks all for any help.
I've learned how to show a file, and that's what I'm doing.
It shows what I do to read the time on a DS3232. It reads the initial values I set to begin with, but I can't get it to access the time at any other time after the time I set to begin with. I am quite ready to believe I have missed some technique, and I'd be very pleased to be shown how to do it. What do I do ?
Another difficulty is where I convert BCD to DECIMAL, towards the end of the program. Why does the conversion need the # sign? I don't seem to be able to use the value to compare the clock's times with a decimal value of mine.
Thanks all for any help.
Code:
#picaxe 20M2
;clock DS3232
symbol secs = b0 ; DS3232 data
symbol mins = b1
symbol hour = b2
symbol dow = b3
symbol days = b4
symbol mnth = b5
symbol year = b6
symbol cfg = b7
symbol deci = b8
hi2csetup i2cmaster, %11010000, i2cslow, i2cbyte
; SS MM HH DOW DD MM YY. Set date and time to 2001-02-28 23:59:45
hi2cout 0,( $45, $59, $23, 0, $28, $02, $01, $10 )
do
;hi2csetup i2cmaster, %11010000, i2cslow, i2cbyte
hi2cin 0,( secs, mins, hour, dow, days, mnth, year, cfg ) ; Read the DS3232 data
pause 300
b13 = secs
b14 = b13/16*$FA+b13
sertxd(#b14," ")
loop
end