detecting if DS1302 is programmed or not

Hello everyone,
I've ask this before can not still figure it out. I still can not get the Temp.bit8 concept down. But why would this routine not work? Detection of the Clock not being programmed. With the clock reset, it seems to work, but is it correct? thanks for any help
reg = CWPr ' Initialize DS1302
ioByte = WPr0 ' Clear Write Protect
GOSUB RTC_Out ' Send Command
GOSUB Get_Time
IF (secs <> $80) THEN start 'Clock is programmed and working'
DEBUG "STOP": ' Clock needs programming
PAUSE 3000
stop
Start:
hrs = $00
mins = $00
secs = $00
Howard
I've ask this before can not still figure it out. I still can not get the Temp.bit8 concept down. But why would this routine not work? Detection of the Clock not being programmed. With the clock reset, it seems to work, but is it correct? thanks for any help
reg = CWPr ' Initialize DS1302
ioByte = WPr0 ' Clear Write Protect
GOSUB RTC_Out ' Send Command
GOSUB Get_Time
IF (secs <> $80) THEN start 'Clock is programmed and working'
DEBUG "STOP": ' Clock needs programming
PAUSE 3000
stop
Start:
hrs = $00
mins = $00
secs = $00
Howard
Comments
e.g. --
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support