Department of Computer Science and Information EngineeringNational Cheng Kung University
HANEL
SERIAL COMMUNICA-TION
PROGRAMMINGDoubling BaudRate(cont’)
.....SLOWSP:
MOV A,PCON ;read PCONSETB ACC.7;set SMOD low for 4800MOV PCON,A ;write PCON
OVER: MOV DPTR,#MESS1;load address to messageFN: CLR AMOVC A,@A+DPTR;read valueJZ S1;check for end of lineACALL SENDCOM ;sendvalue to serial portINC DPTR;move to next valueSJMP FN ;repeat
;------------SENDCOM:MOV SBUF,A ;place value in bufferHERE: JNB TI,HERE;wait until transmittedCLR TI ;clearRET;return;------------MESS1: DB “The Earth isbut One Country”,0END