0% found this document useful (0 votes)
7 views

Digital Assignment 5

embedded c assignement

Uploaded by

Affan Ahmmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Digital Assignment 5

embedded c assignement

Uploaded by

Affan Ahmmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Digital Assignment 5

Embedded C Lab DA
Winter Semester 24
Submitted by,
Affan Ahmmed
21BEI0006
Expt 5a.: 12-3-24

Using Timer in 8051

1. 50ms delay

Aim: to program the timer on the 8051 microcontroller to time 50ms toggles.

XTAL = 11.0592MHz

Algorithm:

1. Calculate the initial value of the timer for the required time delay according to the supplied
XTAL frequency.
2. Set TMOD and TCON values to their appropriate HEX values
3. Set initial values for TH0 and TL0
4. Compliment the required output bit and call the delay function on each iteration
Code:
Output
2. 0kHz sq wave
3. 500ms delay
Expt 5b.: 19-3-24

Using Counter in 8051

1. Up counter to toggle at 10 counts

Aim: to program the counter on 8051 to check for 10 counts to print given output.

Code:

Output
2. Serial communication through UART on 8051

Aim: to program the 8051 to serially transfer given string through the UART pins

Code:
Output:

Result:

You might also like