- This topic has 0 replies, 1 voice, and was last updated 11 years, 6 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
|
i have written a program for my miniproject -automatic room light controller with visitor counter………….but it is not working………..i don’t know how to correct my program and i have to submit it in next week………….please help me………….i am enclosing my progrm here
ORG 000
SJMP main
ORG 000BH
MOV R4,#40H
MOV A,R2
MOV B,#10
DIV AB
ADD A,R4
MOV R0,A
MOV A,@R0
MOV P0,A
SETB P2.7
CLR P2.6
CALL DELAY
MOV A,B
ADD A,R4
MOV R0,A
MOV A,@R0
MOV P0,A
SETB P2.6
CLR P2.7
MOV TH0,6FH
MOV TL0,0FDH
SETB TR0
RETI
main:MOV 40,#0C0H
MOV 41,#0F9H
MOV 42,#0A4H
MOV 43,#0B0H
MOV 44,#99H
MOV 45,#92H
MOV 46,#82H
MOV 47,#0F8H
MOV 48,#80H
MOV 49,#98H
MOV R2,#00
MOV TMOD,#02H
MOV IE,#82H
MOV TL0,#0FDH
MOV TH0,#6FH
SETB TR0
RPT1:JNB P1.0,RPT2
CALL IN
RPT2:JNB P1.1,RPT1
CALL OUT
IN:JNB P1.1,IN
INC R2
CJNE R2,#01,RETURN
SETB P2.5
RETURN:RET
OUT:JNB P0.0,OUT
DEC R2
CJNE R2,#00,NXT
CLR P2.5
NXT:RET
DELAY:MOV R5,#03H
MOV R6,#85H
L1:DJNZ R6,L1
L2:DJNZ R5,L2
RET
END
when i debugged the program,the instructions of subroutines IN and OUT never get executed.once these subroutines is called,it stucks in their first instruction…………………………………………….
please help me to correct my program,i want to submit it next week