project on part detection
Discussion in "Project Help" started by yogesh puri May 24, 2017.
Wed May 24 2017, 04:04 am
i am unable to simulate following code in protous. output port p1 not giving any results as per programe. i need this code on urgent basis. pl. help me.
;******************************************************************************************************
;
;******************************************************************************************************
; XTAL Freq = 12 MHz
;DATA IN PORT P3
;+++++++++++++++++++++++++++++++++++
;
;##################################################
MOV P3,#0FFH ; P3 ASSIGNED AS INPUT PORT FOR LM324 OUTPUT
MAIN:
MOV A,P3
CLR C
SUBB A,#11111110B
JNZ NEXT
AJMP EMPTY
NEXT: MOV A,P3
CLR C
SUBB A ,#11111100B
JNZ NEXT1 ; 2 KEY PRESSED
AJMP NOTOK
NEXT1: MOV A ,P3
CLR C
SUBB A ,#11111000B
JNZ NEXT2 ; 8 KEY PRESSED
AJMP OK
NEXT2:
AJMP MAIN
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
EMPTY:
;CAGE IS EMPTY
MOV P1,#11110000B
AJMP MAIN
NOTOK:
;PART IS NOT OK
MOV P1,#10101010B
AJMP MAIN
OK:
;PART IS OK
MOV P1,#00000000B
AJMP MAIN
END
;******************************************************************************************************
;
;******************************************************************************************************
; XTAL Freq = 12 MHz
;DATA IN PORT P3
;+++++++++++++++++++++++++++++++++++
;
;##################################################
MOV P3,#0FFH ; P3 ASSIGNED AS INPUT PORT FOR LM324 OUTPUT
MAIN:
MOV A,P3
CLR C
SUBB A,#11111110B
JNZ NEXT
AJMP EMPTY
NEXT: MOV A,P3
CLR C
SUBB A ,#11111100B
JNZ NEXT1 ; 2 KEY PRESSED
AJMP NOTOK
NEXT1: MOV A ,P3
CLR C
SUBB A ,#11111000B
JNZ NEXT2 ; 8 KEY PRESSED
AJMP OK
NEXT2:
AJMP MAIN
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
EMPTY:
;CAGE IS EMPTY
MOV P1,#11110000B
AJMP MAIN
NOTOK:
;PART IS NOT OK
MOV P1,#10101010B
AJMP MAIN
OK:
;PART IS OK
MOV P1,#00000000B
AJMP MAIN
END
Thu May 25 2017, 02:53 am
i am unable to simulate following code in protous. output port p1 not giving any results as per programe. i need this code on urgent basis. pl. help me.yogesh puri
It probably is giving the results as per the program, just not what you expect.
You will have to tell us what you wanted to happen.
Ideally post your Proteus simulation.
Fri May 26 2017, 04:03 am
dear sir
if i simulate the above program in keil its working ok. but in proteous port p1 remains high no change in pin logic as per program. if i send bit change command then port1 logic changes, i am feeling there is something wrong with CJNE or SUBB command. pl. help
if i simulate the above program in keil its working ok. but in proteous port p1 remains high no change in pin logic as per program. if i send bit change command then port1 logic changes, i am feeling there is something wrong with CJNE or SUBB command. pl. help
Powered by e107 Forum System