Department of Computer Science and Information EngineeringNational 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 highMOV A,SBUF ;otherwise due to receiveMOV P0,A ;send incoming data to P0CLR RI ;clearRI since CPU doesn’tRETI ;return from ISR
TRANS: CLR TI ;clear TI since CPU doesn’tRETI ;return from ISREND