1
12kviews
Write an assembly language program for sending message BEST serially at 9600 baud continuously using 8051.
1 Answer
written 6.2 years ago by |
MOV TMOD, #20H ; Timer 1 is in mode 2
MOV TH1, # -3 ; 9600 baud rate
MOV SCON, #50H
MOV P0, # 'B'
MOV P1, # 'E'
MOV P2, # 'S'
MOV P3, # 'T' ; make P0, P1, P2 & P3 as input ports
SETB TR1 ; Start timer 1
REPEAT: MOV A, P0
ACALL GO
MOV A, P1
ACALL GO
MOV A, P2
ACALL GO
MOV A,P3
ACALL GO
SJMP REPEAT
GO: MOV SBUF, A ; Loading data into SBUF
HERE: JNB TI, HERE ; Wait till transmission ends
CLR TI ; Clear TI for next transmission
RET