Microcontrollers and Its Applications: ECE3003 Lab Task 4
Microcontrollers and Its Applications: ECE3003 Lab Task 4
Microcontrollers and Its Applications: ECE3003 Lab Task 4
ECE3003
Lab Task 4
1|P a g e
Question 1
Write an 8051 assembly program to transfer data serially at baud
rate 9600 with 8-bit data, one stop bit and observe the transmitted
data in the serial window of the simulator.
Code
ORG 0000H
XX: MOV DPTR, #MYDATA
MOV TMOD, #20H MOV
TH1, #-3
INC DPTR
2|P a g e
Output
Result
“VIT UNIVERSITY” has been successfully transmitted serially and
displayed in the serial window.
3|P a g e
Question 2
Write an 8051 Assembly Language program to get data from the PC
and display it on P1. Assume 8051 is connected to PC and observe the
incoming characters. As you press a key on the PC's keyboard, the
character is sent to the 8051 serially at 4800 baud rate and is
displayed on LEDs. The characters displayed on LEDs are in ASCII
(binary).
Code
ORG 0000H
MOV TMOD, #20H
MOV TH1, #-6
MOV SCON, #50H
SETB TR1
HERE: JNB RI, HERE
MOV A, SBUF
MOV P1, A
CLR RI
SJMP HERE
END
4|P a g e
Output
With Input ‘3’ in UART1
5|P a g e
Result
The input from the PC (using UART1) is being displayed on the Port 1
at 4800 baud rate in ASCII format.
6|P a g e