You are on page 1of 1

Assignment Sheet 3

Note:
I. In case, the problem can have multiple solution please explore each of them.
II. Draw Flowchart and write the Program in EdSim51
1. Write a program to search an alphabet character from text string of size 20. The string
may have alphanumeric including special characters. Compute the number of
comparisons program encounters and searched element and display it on LCD as
character followed by number of comparision with gap of 10 miliseconds. In case no
character found, display 0. You are required to generate the time gap using:
a. Timer 0 in mode 1 with gate 0.
b. Timer 0 in mode 2 with gate 1.
c. Timer 0 in mode 3 with gate 0.

2. Write a program to generate a square wave of 2KHz frequency on Pin1.5. You are
required to use timer in mode 0.
3. Write a program that continuously gets 8-bit data from P0 and sends it to P1 while
simultaneously creating a square wave of 200 microsec period on pin P2.1. Use timer1 to
create the square wave. Assume that XTAL=11.0592MHz
4. Assume that a 1 Hz frequency is connected to input pin P3.4. You are required to count
clock period in group of 60 time period and display on LCD formed using counter 1.
5. Suppose a binary string of size 50 is given input pin P3.4. You are required to count
number of 1’s in given string. Write the program using Counter-1 with Gate-1.
6. Assume that th INT1 pin is connected to a switch that is normally HIGH. Whenever it
goes LOW, it should turn ON an LED. The LED is connected to P1.3 and normally OFF.
When it is turned ON it should stay ON for a fraction of a second. As long as the switch is
pressed LOW, the LED should stay ON. You are required to keep on display LED for fixed
amount of time.
7. Repeat the question 2 with the use of TF(Trap flag) as interrupt.

You might also like