snabilat
Member level 3
hi here is subroutine for cal. of 1 sec delay
HUNDERED EQU 100
COUNT EQU -10000 ;100*10000 US=1SEC
DELAY: MOV R7,#HUNDERED
AGAIN: MOV TH0,#HIGH COUNT
MOV TL0,LOW COUNT
SETB TR0
WAIT2: JNB TF0,$
CLR TF0
CLR TR0
DJNZ R7,AGAIN
RET
END
****************************************************
The clock used is a 12MHz .
HUNDERED EQU 100
COUNT EQU -10000 ;100*10000 US=1SEC
DELAY: MOV R7,#HUNDERED
AGAIN: MOV TH0,#HIGH COUNT
MOV TL0,LOW COUNT
SETB TR0
WAIT2: JNB TF0,$
CLR TF0
CLR TR0
DJNZ R7,AGAIN
RET
END
****************************************************
The clock used is a 12MHz .