Digital Assignment 5
Digital Assignment 5
Embedded C Lab DA
Winter Semester 24
Submitted by,
Affan Ahmmed
21BEI0006
Expt 5a.: 12-3-24
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
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: