[go: up one dir, main page]

0% found this document useful (0 votes)
71 views8 pages

Mod4 Cat2 Pyq

The document contains a series of programming tasks for the 8051 microcontroller, each requiring the development of assembly language programs (ALPs) to perform specific functions such as generating frequencies, counting events, and monitoring inputs. Tasks include generating waveforms, implementing logical operations, and handling serial communication, with various scenarios involving timers and interrupts. The document outlines 34 distinct questions, each focused on different aspects of microcontroller programming and interfacing.

Uploaded by

adnanfaisal1762
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)
71 views8 pages

Mod4 Cat2 Pyq

The document contains a series of programming tasks for the 8051 microcontroller, each requiring the development of assembly language programs (ALPs) to perform specific functions such as generating frequencies, counting events, and monitoring inputs. Tasks include generating waveforms, implementing logical operations, and handling serial communication, with various scenarios involving timers and interrupts. The document outlines 34 distinct questions, each focused on different aspects of microcontroller programming and interfacing.

Uploaded by

adnanfaisal1762
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/ 8

Q1.

Develop an Assembly Language Program (ALP) using interrupts to do the


following:
(a) Generate a 10 KHz frequency on P2.1 using To 8-bit auto reload
(b) Use timer 1 as an event counter to count up 1-Hz pulse and display it on P0.
The pulse is connected to EX1
Assume that XTAL = 11.0592 MHz.

Q2.
Develop an ALP to Implement Y=AB+BC’+A’C in 8051 Microcontroller.

Q3.
An 8051 microcontroller operating with crystal frequency of 11.0592 MHz is
connected to a switch at P1.0. Write an ALP to monitor the status of switch for
every 1ms after successful transmission of the message. If the switch is open,
then transmit a string “PLACE TO LEARN” stored at ROM location of 200H
at 9600 baud rate. If the switch is closed, then transmit a string “CHANCE TO
GROW” stored at ROM location 400H at 4800 baud rate. Use timer for the
delay generation. Assume the overhead delay caused due to transmission of
string is negligible.

Q4.
The car parking area can accommodate a maximum of 100 cars. Assume that a
sensor is connected to P3.4 of 8051 microcontroller to sense the car entering
the parking area. If the count reaches 100, the microcontroller should turn
“ON” a buzzer connected to P1.7 for 1 second. Assume the crystal frequency as
22 MHz. Write a suitable 8051 assembly code to implement.

Q5.
Develop a program to receive data until the received data is “N”, means if 8051
receives “N” then it should stop receiving the character. Baud rate of 9600.
Q6.
Develop an ALP to Implement Y=X’Y’+XY’Z+Y’Z in 8051 Microcontroller

Q7.
An 8051 microcontroller based system is designed to count the students
entering into a class room of capacity 60, where an enable switch is connected
to the microcontroller port which helps the faculty to start the counting process.
After 3 minutes of the counting process, a motor which is connected to the P2.1
should be turned ‘ON’ to close the door by sending ‘HIGH’ value to P2.1. Also
the final count value after 3 minutes should be sent to P1. Develop an ALP for
the above scenario.

Q8.
Develop an Assembly Language Program (ALP) using interrupts to do the
following:
(a) Receive data serially and send to P1
(b) Read port 2, transmit data serially, and give a copy to P0
(c) Make timer 0 generate a square wave of 2 KHz frequency on P3.6
Assume that XTAL = 11.0592 MHz. Set the baud rate at 9600.

Q9.
Develop an ALP to implement Y=PQ’+Q’R’+P’Q’R’ in 8051 Microcontroller

Q10.
Develop an ALP for the following scenario: Get an 8-bit data “X” from port P0
and another 8-bit data “Y” from port P1. Perform “X-Y” and send the result
through serial port at 19200 baud rates for 150 times.

Q11.
Develop an 8051 Assembly Language Program (ALP) to get an 8-bit input data
from port P1, find the square of the input data and send the lower byte of the
result to port P0 and higher byte of the result to port P2 continuously, while
simultaneously generating a rectangular wave with 75% duty cycle using timer
at pin P3.7

Q12.
Assume P1.1 and P1.2 are the two inputs of OR gate, the output of this OR gate
is connected as one input of a NAND gate, and the other input of this NAND
gate is P1.3. The output of this NAND gate is connected to P2.4. This logic
circuit is to be implemented within 8051 microcontroller. Pictorially represent
the logic circuit given above and develop an assembly language
program to implement the logic operation.

Q13.
Assume that two sensors are connected to P3.4 and P3.5 of the 8051
Microcontroller. Sensor connected to P3.4 is placed near entry door of the
auditorium and another sensor is connected to P3.5 is placed near the exit door.
The maximum capacity of the auditorium is 200. Write an ALP to find the
number of people
inside the auditorium and send the count to port P0. An LED
connected to P1.7 will glow if the auditorium is full.

Q14.
Develop an ALP for 8051 Microcontroller to initiate with counter 1 in mode 2.
When the count reaches 25, turn on the buzzer for 1 second which is connected
in port pin P1.2.

Q15.
Assume a switch is connected at P1.2. Develop an ALP for 8051 based on the
status of the switch. If the SW = 0 then generate a square wave of 2KHz using
timer 0 and if SW = 1, then generate a square wave of 5KHz using timer 1.

Q16.
Develop an 8051 based ALP for the following scenario: Imagine a sensor is
connected with the pin P3.2 (INT1) of 8051 to count the number of entries
inside the hall. For this, you can feed the input by connecting a switch at P3.2
in which each CLOSING of switch indicates the number of incoming persons
entering into the hall. Count the number of persons and display the value in
Port1. When the count becomes 100 transmit the message "FULL" serially at
the baud rate of 4800.

Q17.
Develop an 8051 based ALP to implement the Sum and Carry expression for
Full Adder circuit.

Q18.
Write an assembly language program in which the 8051 gets data from P1 and
sends it to P2 continuously while incoming
data from the serial port is sent to PO. Assume that XTAL=11.0592 MHz. Set
the baud rate at 9600.

Q19.
Assume that 8051 microcontroller XTAL = 11.0592 MHz. What value do we
need to load the timer's register, if we want to have a
time delay of 5 ms (milliseconds)? Show the assembly language program for
Timer 0 to create a pulse width of 5 ms on P2.3.

Q20.
Two switches (SW1 and SW2) are connected to P1.2 and P1.3 of 8051
microcontroller. Develop an ALP to monitor the status of switches and
transmit the following messages with the given baud rate.
Q21.
Let an input device is connected to P1 of 8051 Microcontroller. Develop an
ALP that continuously monitors the MSB and LSB pins of P1 and based on
the binary combinations generate square waveforms as given in table 1.

Q22.
Assume there are two switches connected to PortO of 8051 Micro controller.
Develop an ALP that continuously monitors the MSB and LSB pins of PO and
based on the binary combinations; perform the actions as given in table 1.
Q23.
Assume 8051 Microcontroller is used in a highway toll collection system.
There are two sensors connected to 8051: one for entry (at INTO) and the other
for exit (at INT1) Whenever a vehicle enters the billing station, the sensor at
the entry point sends an active low signal to the system and this will enable the
system to generate a maximum delay using timer1 in mode2. After this delay,
the sensor at the exit will show an active low signal to the system and this will
generate a maximum delay using timero in mode 2. Develop an ALP to
implement this scenario.

Q24.
Draw and explain the interfacing diagram of a seven-segment display with an
8051 microcontroller and build an assembly to display 1, 4, 1, 4... continuously
with a delay of 1 ms between each digit. Use a timer to generate the time delay.

Q25.
Write an 8051 assembly language program to continuously get 8-bit data from
PO
and send it to P1 while simultaneously creating a square wave of 200 us period
on pin P2.1. Use Timer 0 to create the square waveform. Assume
XTAL=11.0592 MHz.

Q26.
Write an 8051 assembly language program to create a waveform with a 33%
duty cycle on P0.2 using Time. Assume the delay and Provide the necessary
calculations.

Q27.
Write an ALP for generating a clock pulse of frequency 2KHz on P1.2 by using
Timer 0 Mode 1. Provide necessary calculation.
Q28.
Write an 8051 assembly program to generate a 2ms waveform with 50% duty
cycle (Square wave generator) on the port pin P1.5. Assume the clock
frequency of 8051 is 12 MHz and use the timer T1.

Q29.
Write an 8051 (AT89C51) ALP to generate a pulse waveform with a frequency
of 2KHz using a timer. Don't access the TLO or TL1 register in the ALP.
Provide the necessary timer calculations.

Q30.
Write 8051 (AT89C51) ALP for the following logic. The existing values
of TCON-01H and IE=0FFH.
IF (P3.2 == 1)
GENERATE WAVEFORM WITH 50% DUTY CYCLE.
ELSE
GENERATE WAVEFORM WITH 33% DUTY CYCLE.

Q31.
Write an 8051 (AT89C51) ALP to generate a periodic waveform
simultaneously as follows: i) 0.1ms ON & 0.1ms OFF ii) 0.2ms ON & 0.2ms
OFF using a timer.
Don't access TL0 or TLI register in the ALP. Provide necessary timer
Calculations

Q32.
Write 8051 (AT89C51) ALP for the following logic. The existing values of
TCON-01H and IE=OFFH.
IF (P3.3=1)
SEND THE SEQUENCE 0,1,2,3,5,6,7,8,9 REPEATLY IN P0.
ELSE
SEND THE SEQUENCE 9,8,7,6,5,4,3,2,1 REPEATLY IN P1.
Q33.
Write an 8051 ALP language to generate a pulse waveforms with a duty cycle
of 43% approximately (42.86%) in all the bits of the Port-1 without using
timer. y
Don't assume the number of machine cycles for any instructions.

Q34.
Find the delay (D) generated by the timer-0 if it has the following settings
TMOD = 01H, THO = 00H and TL0 = 00H. Write 8051 ALP to generate a
pulse
waveform with frequency f =1/(2D) and duty cycle = 50% using timer-0 and
simultaneously transfer data from Port-0 to Port-1. Assume XTAL = 11.0592
MHz.

You might also like