SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR ELECTRONICS & COMMUNICATION DEPARTMENT Question Bank- 1 Subject: Microcontroller and Interfacing (151001) Class: B.E.Sem V (EC-I & II) Q-1 Explain RISC and CISC? Which is most suited to Intel 51 Microcontroller? Why? Q-2 What is Special Function register (SFR) of 51-Microcontroller? List all the SFR and explain SBUF, IP and PCON Q-3 What is Pseudo Codes? Explain it. Q-4 Explain control circuitry between output latch and pins for port 0, port 1, port 2 and port 4. Q-5 Explain indirect addressing, external data moves and code memory read only data moves with instructions. Q-6 Write an 8051 C program to calculate the checksum bye for given data.4 bytes of hexadecimal data: 25h, 62h, 3Fh, and 52h. Q-7 Write a program to check if the character string of length 7, stored in RAM location40h onwards is a palindrome. If it is, output Y to P1. Hint: A palindrome is a string in which the characters are same whether the string is read in forward or reverse direction. Q-8 Sixteen random numbers are stored in an array, starting from location 40H. Write an assembly program to count the number of non-zero elements in this array and store it in location 30H. Q-9 Write an 8051 C program to convert 8-bit binary data to decimal and display the digits on P0, P1, and P2. Q-10 Write a program to calculate the average of an array of unsigned positive integers. The array starts from 41H and number of terms in the array is available in location 40H. Store the calculated average in location 3FH. Page 1 of 5
Q-11 Why there is no Sign-flag in MCS-51? Q-12 Can we implement the interrupt to watch the TF bit of TCON Special Function Register? Explain it. Q-13 Write an 8051 C program to toggle all bits of P2 continuously every 500 ms. Use Timer 1, Mode 1 to create the delay. Q-14 Write an 8051 C program to toggle all the bits of P0 and P2 continuously with a 250ms delay. Use the inverting operator. Q-15 What is Serial Communication? How it will perform using 8051/52 Controller with PC? Explain it with program and diagram. Q-16 Explain Serial data transmission modes in detail. Q-17 Calculate the reload value for Timer 1 in mode 2 to generate a baud rate of 2400, if 8051 is interfaced with a 12 MHz crystal. Q-18 Write an assembly as well as C program to transfer the message ONE serially at 9600 baud, 8-bit data, 1 stop bit. Perform this program for 255 times. Q-19 Explain the difference between the low- level and edge-triggered interrupts. Q-20 Explain two types of activation for external hardware interrupts in detail and also discuss the significance of Gate bit in TMOD register. Q-21 Explain which technique, Interrupt or Polling, avoids trying down the Microcontroller. Q-22 What are the interrupts available in the 8051 microcontroller? Explain interrupt enable (IE) SFR and Interrupt priority (IP) SFR. Q-23 Explain timer flag interrupt, serial port interrupt and external interrupts with example. Q-24 Draw and explain RESET and clock circuit of 8051 microcontroller. What is the purpose of capacitor in RESET circuit? Q-25 Draw schematic diagram for 8051 minimum hardware configuration. Explain function of power on reset circuit. Q-26 How Liquid Crystal Display (LCD) is superior to conventional Display? Explain it. List and describe the LCD Instructions. Q-27 Discuss interfacing of the LCD with 8051 microcontroller. Draw interfacing diagram. Write program to display message GTU IS BEST on the LCD screen. Q-28 Draw and explain interfacing of 4x4 matrix keyboard with 8051 microcontroller. Write program to read switch. Page 2 of 5
Q-29 Explain keyboard interfacing with 8051 and also draw flow chart for Detection and identification of key activation. Q-30 Draw interfacing diagram for interfacing of common anode seven segment displays with 8051 microcontroller. Write program to display digit 0 to 9 at the interval of approximately 1 second (Consider crystal frequency 12 MHz). Q-31 Draw and Explain 8051 connection to ADC 0804 with self checking mode. Q-32 Explain interfacing of 8051 with ADC0804 chip. Q-33 Explain interfacing of analog to digital converter (ADC) with microcontroller. Write program to read analog value from ADC on port P1 and display digital values on LEDs connected at port P0. Q-34 Draw schematic diagram of 8051 interfaced with ADC0804. Use the 8051 clock to generate necessary clock signal for ADC0804. Use P1 for Data line connection and P2 for other control signals. Write either assembly or C program for above circuit to convert analog signal into digital and store it in internal RAM. Q-35 Draw interfacing diagram of DAC with 8051 microcontroller. Write program to generate sine-wave at the output of DAC. Use lookup table to store hex values. Q-36 Draw and explain 8051 connection to external RAM (8Kx8). Write a program to read 100 bytes of data from P1 and save the data in external RAM starting at 5100H location. Q-37 Discuss interfacing of external 32K EPROM and 32K RAM with the microcontroller. Draw diagram and explain important handshaking signals. Q-38 Explain connection between an 8031 and an external memory consisting of 16K EPROM and an 8K of static RAM with external memory timing diagram. Q-39 Draw a schematic diagram of 8051 interfaced with 2K external RAM. With reference to interface diagram drawn, give the range of memory for which memory can be accessed. Q-40 Discuss RTC interfacing with microcontroller. Write program to get values of hour, minute and second from RTC to RAM location 20h,21h and 22h respectively. Q-41 Describe RTC interfacing with micro controller. Write program to get values of hour, minute and second from RTC to RAM location 50h, 51h and 52h respectively. Page 3 of 5
Q-42 Answer the following questions (1 mark each) (i) What is the purpose of EA pin in 8051 microcontroller? (ii) What is the purpose of EA bit in IE SFR? (iii) What is the function of ALE signal? (iv) Why pull-up resistors are necessary with port P0 in 8051 microcontroller. (v) What is the function of SMOD bit in TCON SFR? (vi) What is the function of GATE bit in TMOD SFR? (vii) Write instruction to select register bank 2. Under which condition 8051 with internal 4K program memory would (viii) access external program memory? Q-43 Write a C program using interrupts to do the following: (i) Generate a 1000 Hz frequency on P2.1 using T0 8 bit auto reload, Use timer 1 as an event counter to count up a 1-Hz pulse and display it on (ii) P0.The pulse is connected to EX1. Assume that XTAL=11.0592 MHz. Set the baud rate at 9600. Q-44 Assume that a switch is connected to pin P2.0. Write a assembly language program to monitor the switch and perform the following: (i) If SW=0 send the message GOOD to the serial #0 port. (ii) If SW=1 send the message MORNING to the serial #1 port. Q-45 Assume that input at port P1 is data for temperature. Two LEDs are connected at P0.0 (RED) and P0.1 (GREEN) with their anodes pulled up through 820 Ω resistor and cathodes are connected with pins. LEDs Write a program to acquire temperature data and indicate the status on LED as below. Note: It is require continuously monitoring the temperature and indicating status on LEDs. If TEMP _ 10 RED LED ON and GREEN LED OFF If 10 < TEMP _ 80 RED LED OFF and GREEN LED ON IF TEMP > 80 RED LED ON and GREEN LED OFF Q-46 Draw interfacing diagram to interface push-button switch at port pin P3.3 and relay with transistor circuit at port pin P2.0. Write program such that when push-button key is pressed, relay should become ON. When push-button key is pressed again relay should become OFF (i.e. toggling of relay by push-button switch). Page 4 of 5
Q-47 Explain interfacing of stepper motor with microcontroller. Write program to rotate stepper motor in clockwise direction continuously in full step mode. Q-48 Draw a schematic diagram of 8051 interfaced with unipolar stepper motor. Give reason, one need driver IC or circuit for interfacing stepper motor with 8051. Q-49 Write a program to rotate a stepper motor, as interfaced in above problem, by 64 in clockwise direction. Assume the motor has a step angle of 2. Use the 4 step sequence. Q-50 Describe interfacing of 8051 with DC motor and PWM. Signature of Faculty Member (Prof. Rahul G. Patel) Page 5 of 5