This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

serial interrupt problem

Hello there!
i am writing a program in which i must monitor port P2.0 to be low and execute some sort of code but i also want that when some data is received in SBUF the control should be transfered to the serial interrupt and after serving ISR return to monitor P2.0 to be low . so the problem is that i contineously monitor P2.0 to be low that code works efficiently but it does not call the serial interrupt when data is trasfered to serial port of 8051 the code slice is given below:

org 00h
jmp main
org 23h
call serial

main:
mov tmod,#20h
mov th1,#-3
mov scon,#50h
setb tr1

jb p2.0,$
-----------
-----------
----------- Some Code
-----------
-----------
;Serial ISR
serial:
MOV A,SBUF
oneon:
cjne A,#'A',last
setb P1.0
clr RI
reti
last:
clr RI
reti
end

0