Lab Embedded
Lab Embedded
&
Embedded Systems
(MTS -331)
DE-44 Mechatronics
Syndicate – C
Lab Report
Week # 7
Names of Members:
1. GC Ahmed Hassan
Reg # 431990
Reg # 431979
1
Abstract:
This lab aimed to introduce basic coding techniques using Keil software, integrated
with the 8051 microcontroller in Proteus, to provide hands-on experience with
assembly coding and debugging tools. The objective was to gain foundational
knowledge of embedded systems operations.
Introduction:
The lab focused on key microcontroller functions within the Keil µVision
environment for the 8051. We performed delay calculations and explored the concepts
of machine cycles and clock cycles.
Tools:
The software used includes:
● Keil µVision
Procedure:
2
Figure 1 : TASK 1
1. Initialization:
○ TMOD = 01H: Set Timer 0 to 16-bit mode.
○ Set P1.1 high to initiate the PWM cycle.
2. PWM Loop:
○ High Time: Load TH0 and TL0 with FFH and 014H for a 228 µs delay,
then wait for TF0 overflow before setting P1.1 low.
Figure 2 :TASK2
○ Low Time: Set TH0 and TL0 to FFH and 039H for a 57 µs delay, then
wait for TF0 overflow and set P1.1 high to continue the cycle.
3
Figure 3: TASK 2
Part 2: Programming in C
Conclusion:
This lab provided practical experience in coding and debugging for the 8051
microcontroller, reinforcing key concepts in embedded systems and preparing us for
more advanced projects.