As in AXE033, page #7, I have used the s/w and h/w,"Using the optional Clock [DS1307] upgrade in i2c mode". A LED is connected to leg#7 of DS1307 through a resistor to the +Vcc rail. When I run the following program, the LED comes ON (dim) instantly and then after a few seconds becomes bright. As per my program the LED has to turn ON after 2 minutes, and turn OFF afetr 20 seconds.
Would some one please pick the mistake?
symbol hour=b2
symbol minute=b1
symbol second=b0
main:
i2cslave %11010000,i2cslow,i2cbyte
writei2c 0,($00,$57,$11,$05,$18,$11,$06,$10)
end
i2cslave %11010000,i2cslow,i2cbyte
Loop1:
Pause 30000 ;wait 30sec
readi2c 0,(b0,b1,b2);read sec,min,hour
if b2<>11 then loop1;if hour not 11 goto loop1
if b1<>59 then loop1;if min not 59 goto loop1
high 7 ;turn ON led/buzzer
pause 20000 ;wait 20sec
low 7 ;turn OFF led/buzzer
pause 60000 ;wait 60sec
goto loop1
Would some one please pick the mistake?
symbol hour=b2
symbol minute=b1
symbol second=b0
main:
i2cslave %11010000,i2cslow,i2cbyte
writei2c 0,($00,$57,$11,$05,$18,$11,$06,$10)
end
i2cslave %11010000,i2cslow,i2cbyte
Loop1:
Pause 30000 ;wait 30sec
readi2c 0,(b0,b1,b2);read sec,min,hour
if b2<>11 then loop1;if hour not 11 goto loop1
if b1<>59 then loop1;if min not 59 goto loop1
high 7 ;turn ON led/buzzer
pause 20000 ;wait 20sec
low 7 ;turn OFF led/buzzer
pause 60000 ;wait 60sec
goto loop1