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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/23/17 10:55
Read: times


 
#190743 - 8052 Serial Interupt
For one of my application, I want to have Serial Transmission of Data using 8051 by Polling (under my software control) whereas I want to receive the data using Serial Interrupt.

I tried to do this using following code sequence but this doesn't work.

With the code mentioned below, serial reception of data is working perfectly but data is at all transmitted.

If I just remove the SETB ES instruction from the code, the Serial transmission of data works perfectly and Reception of data is not working.

;-------------------------
SETB ES

Repeat: mov a,#"H"
LCALL SNDBYT
mov a,#"E"
LCALL SNDBYT
mov a,#"L"
LCALL SNDBYT
mov a,#"L"
LCALL SNDBYT
mov a,#"O"
LCALL SNDBYT

MOV R2,#30
WAIT: LCALL DELAY
DJNZ R2,WAIT

LJMP Repeat

SNDBYT: NOP
SND_WAIT: JNB TI,SND_WAIT ; wait until TI bit is set
CLR TI ; TI will be set when SBUF has sent byte
MOV SBUF,A ; move byte from ACC to buffer
RET
;----------------------------
SER_INT: NOP
JB RI,RECEIVE
JB TI,SND1
ENDIT: RETI

SND1: clr TI
RETI

RECEIVE: NOP
MOV A,SBUF
CJNE A,#"X",no_action

CLR 90h
lcall delay
SETB 90h

no_action: CLR RI
RETI
;----------------------------------

Can some one guide me for my request ? Or it is simply not possible to have Serial transmission of data by Pooling and Serial Reception of data using Interrupt.



List of 2 messages in thread
TopicAuthorDate
8052 Serial Interupt            01/01/70 00:00      
   tried by many            01/01/70 00:00      

Back to Subject List