| ??? 10/16/03 07:26 Read: times |
#56731 - RE: TIMER HELP Responding to: ???'s previous message |
Hi Dobrica,
You are missing the hours increment and end of day check (for a 24 hour based clock) on your clock assembly routine. Below is the missing code added. Good luck, Charles Bannister
PUSH PSW
PUSH ACC
clr tr0 .
mov th0,#HIGH RELOAD
mov tl0,#LOW RELOAD
setb tr0
INC MSEC
MOV A,MSEC
CJNE A,#64H,CEASEND
MOV MSEC,#00H
INC SEC
MOV A,SEC
CJNE A,#3CH,ceasEND
MOV SEC,#00H
INC MIN
MOV A,MIN
CJNE A,#3CH,ceasEND
MOV MIN,#00H
INC ora
;======================== End of day check
INC HOURS ;; INCREMENT HOURS
MOV A,HOURS ;; 24 HOURS ELAPSED?
CJNE A,#24,cendsEND ;; GOTO END IF NO...
MOV HOURS,#0x00 ;; RESET HOURS LSB
;=======================
CEASEND: POP ACC
POP PSW
RETI
|



