Vous êtes sur la page 1sur 5

1.

Write an assembly language program to generate 450


microseconds delay using nested loop, XTAL =
11.0592 MHz.

2. Write an assembly language program to generate 20


milliseconds delay using nested loop, XTAL = 11.0592
MHz.

3.
Write an assembly language program to generate 20
milliseconds delay using using Timer 0 Mode 1. Give
calculations.

4.
Write an assembly language program to generate 50
milliseconds delay using using Timer 1 Mode 2. Give
calculations.

5.
Find the time delay generated, when TL0 = 00h and
TH0 = CCh, XTAL = 11.0592 MHz.

6.
Find the time delay generated, when TL0 = 00h and
TH0 = 00h, XTAL = 11.0592 MHz.

7.
Find the time delay generated, when TMOD = 02h,
TH0 = 3Ch, XTAL = 11.0592 MHz.
8.
Write an Assembly language program for 8051 to
copy the block of data of internal RAM location 30H -
3AH to the 40H - 4AH.

9.
Write a ‘C’ program to generate a square wave of
frequency 500Hz on P1.0 (using timer 0 in mode 1,
crystal frequency = 12 MHz).

10.
Write a ‘C’ program to generate a square wave of
frequency 10 KHz on P1.2 (using timer 1 in mode 2,
crystal frequency = 12 MHz).

11.
Write a C program to configure a switch on External
Interrupt 0 (Edge triggering mode) and a LED on
P1.0. When a Switch is pressed toggle the LED.

12.
Write a C program to transfer “I AM GREAT” serially
at 9600 baud rate (8 data bits ,1 start bit and 1 stop
bit). Do this continuously.
13.
Write a 'C' program to interface one key on pin P3.0
and one LED on pin P1.0. when a key is pressed
toggle the LED.

14.
Write an assembly language program to transfer “I AM
GREAT” serially at 9600 baud rate (8 data bits ,1 start
bit and 1 stop bit). Do this continuously.

15.
Write an 8051 C program to send values of –4 to +4
to port P1.

16.
Write an assembly language program for 8051 to
send values 00H -0FFH to port P2 with 1 second
delay.
Write an 8051 C program to toggle bit D0 of the port
P1 (P1.0) 50,000 times.

17.
Write an 8051 C program to get a byte of data form
P0. If it is less than 100, send it to P1; otherwise,
send it to P2.
18.
Write an 8051 C program to monitor bit P1.5. If it is
high, send 55H to P0; otherwise, send AAH to P2.

19.
Explain the following program and give the result at
each step of the program.
#include <reg51.h>
void main(void)
{
P0=0x35 & 0x0F;
P1=0x04 | 0x68;
P2=0x54 ^ 0x78;
P0=~0x55;
P1=0x9A >> 3;
P2=0x77 >> 4;
P0=0x6 << 4;
}

20.
Write an 8051 C program to read the P1.0 and P1.1
bits and issue an ASCII character to P0. if P1.1 and
P1.0 is 00 send ‘0’ if 01 send ‘1’, if 10 send ‘2’ and if
11 send ‘3’.
21.
Write an Assembly language program for 8051 to find
the average value of the data given at RAM memory
locations 30h - 3Ah. Place the result at RAM memory
location 10h.

22.
Write an Assembly language program for 8051 to find
the square value of the data given at RAM memory
locations 30h - 3Ah. Place the results at RAM
memory location 40h - 4Ah.

23.
A switch is connected to pin P1.2. Write an 8051 C
program to monitor SW and create the following
frequencies on pin P1.7:
SW=0: 500Hz
SW=1: 750Hz,
use Timer 0, mode 1 for both of them.

24.
A switch is connected to pin P1.7. Use the carry flag
to check the switch status. Write a C program to
check the status of SW and perform the following:
(a) If SW=0, send letter ‘N’ to P2
(b) If SW=1, send letter ‘Y’ to P2

Vous aimerez peut-être aussi