Microcontroller and Embedded System DE-42 Mechatronics: Lab Report Week 12

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Microcontroller and Embedded

System
(MTS-311)
DE-42 Mechatronics
Syndicate –B

Lab Report week 12th

Lab Title: 8051 Serial programming

Names of Group Members:

1. NS Azeem Niazi #332062

2. PC Sardar Abdullah Khan Durani #359130

Submitted to: LD Qasim


Lab Title:
8051 Serial programming
Objective:
To understand the working of timer in 89C51and use it in various ways like delay
or making wave with specific duty cycles.

Introduction:
In serial communication, the data is sent one bit at a time, in contrast to parallel
communication, in which the data is sent a byte or more at a time. The 89C51 has
serial communication capability built into it.

TASK 1:

Code:
TASK 2:
In this task we are showing message “We love our country” at the baud rate of 5600. So firstly,
for baud rate we set TH=255 as it’s the value for baud rate done from calculations. Then we used
the lookup table at ORG 250H for entering our message. Here we are using data pointer and loop
so we can display every word in our message. Our program will run, and we will see our
message displaying “We love our country” continuously.
TASK 2:
We are providing 1 Hz external into pin T0 (P3.4) with 5V along rise and fall time of 500ms. We
have written a C program for counter 0 in mode 1 to display the seconds and minutes on P1 and
P2 respectively. The program is working and the result of program is being showed on proteus.
Code:

Proteus Simulation:

You might also like