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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/10/02 18:43
Read: times


 
#22838 - RE: Timer and Char Input
The main procedure is call switch_loop first and then
call input ...
and then program go into get_key_input now...
I set the timer0 in this subroutine. and
I also have condition....
if the timer0 is not overflowed, go to check if RI is set,,,
if ri is not set yet, return to check TF0 is set or not?
when TF0 is set, go to brachloop to see if the current mode is same as
previous mode,
but my program stoped at JNB, RI, and after I input char, it go back to
returnloop2...
See my code...


returnloop2:
call switch_loop ;
call get_key_input ;


GET_KEY_INPUT:
MOV TH0, #76H ;TIMER0
MOV TL0, #01H
MOV TMOD,#09H
SETB TR0 ;START TIMER0

TEMPLOP1:
JNB TF0, LLL ;IF TIMER0 NOT OVERFLOWED,
CLR TF0
LJMP BRANCHLOOP
LLL:
JNB RI,TEMPLOP1 ;
MOV A,SBUF ;RECEIVE THE DATA
CLR RI
LJMP TEMPLOP2

TEMPLOP2:
RET


BRANCHLOOP:
MOV DPTR, #PRMODE ;READ THE PREVIOUS MODE
MOVX A, @DPTR
MOV B, A ;AND SAVE IT TO B REG
MOV DPTR,#CRMODE ;READ CURRENT MODE
MOVX A,@DPTR
CJNE A, B, RETURNLOOP2 ;IF CURRENT MODE== PREVIOUS MODE, CALL switch
;

Frank


List of 10 messages in thread
TopicAuthorDate
Timer and Char Input            01/01/70 00:00      
RE: Timer and Char Input            01/01/70 00:00      
RE: Timer and Char Input            01/01/70 00:00      
RE: Timer and Char Input            01/01/70 00:00      
RE: Timer and Char Input            01/01/70 00:00      
RE: Timer and Char Input            01/01/70 00:00      
RE: Timer and Char Input            01/01/70 00:00      
RE: Timer and Char Input            01/01/70 00:00      
RE: Timer and Char Input            01/01/70 00:00      
RE: Timer and Char Input            01/01/70 00:00      

Back to Subject List