The Delay Generation ASM Routine For Generating Delay
DELAY_SEG SEGMENT CODE
RSEG DELAY_SEG
DELAY1MS:
MOV R7,#250
DJNZ R7,$
MOV R7,#247
DJNZ R7,$
RET
DELAY100MS:
MOV R6,#99
L1:
ACALL DELAY1MS
DJNZ R6,L1
MOV R6,#250
DJNZ R6,$
MOV R6,#147
DJNZ R6,$
NOP
RET
DELAY1S:
MOV R5,#9
L2:
ACALL DELAY100MS
DJNZ R5,L2
MOV R5,#99
L3:
ACALL DELAY1MS
DJNZ R5,L3
MOV R5,#250
DJNZ R5,$
MOV R5,#138
DJNZ R5,$
RET
The Main ASM Routine For Operation
$INCLUDE(delays.asm)
cseg at 0
MOV A,#0ffH
MOV A,#055H
MAIN:
MOV P2,A
LCALL DELAY1S
LCALL DELAY1S
XRL A,#0FFH
SJMP MAIN
END
Download Keil Project And Proteous Project For This
No comments:
Post a Comment