The 8051 Microcontroller and Embedded

(lily) #1
Department of Computer Scien

ce and Information Engineering

National Cheng Kung University, TAIWAN
HANEL
SERIAL COMMUNI-CATION INTERRUPTUse of Serial COM in 8051(cont’)

...;-----------------SERIAL PORT ISR


ORG 100H
SERIAL: JB TI,TRANS;jump if TI is high

MOV A,SBUF ;otherwise due to receiveMOV P0,A ;send incoming data to P0CLR RI ;clear

RI since CPU doesn’t

RETI ;return from ISR
TRANS: CLR TI ;c

lear TI since CPU doesn’t

RETI ;return from ISREND
Free download pdf