Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/22/00 18:49
Read: times


 
#1576 - RE: Please help me check the source code.
Hi Melvin,

If you want to see the sequence 0123..89012.. when you turn the optocoder clockwise and the sequence 987..210987.. otherwise you must change your program like following.

ORG 0H
JMP MAIN
;
ORG 50H
MAIN: MOV P0,#0FFH ;SET PORT 0 AS INPUT
MOV R1,#10H ;
TOLSD: CALL DISPLAY ;Put digit to screen
GET00: MOV A,P0 ;
ANL A,#003H ;
CJNE A,#000H,GET00 ;
DIRECT: MOV A,P0 ;
ANL A,#003H ;
CJNE A,#001H,NEXT ;
CW: INC R1 ;Forward
CJNE R1,#01AH,PLUS ;
MOV R1,#010H ;
PLUS: JMP TOLCD ;
NEXT: CJNE A,#002H,DIRECT ;CHECK CHANNEL B = 1
CCW: CJNE R1,#010H,MINUS ;
MOV R1,#01AH ;
MINUS: DEC R1 ;Back direction
JMP TOLSD ;
;
DISPLAY: MOV P1,R1 ;
CALL DELAY ;
RET
;
DELAY: OV R5,#035H
F: OV R4,#007H
E: OV R3,#000H
D: JNZ R3,D
JNZ R4,E
JNZ R5,F
RET
END

Bye,

George


List of 4 messages in thread
TopicAuthorDate
Please help me check the source code.            01/01/70 00:00      
RE: Please help me check the source code.            01/01/70 00:00      
RE: Please help me check the source code.            01/01/70 00:00      
RE: Please help me check the source code.            01/01/70 00:00      

Back to Subject List