GUJARAT TECHNOLOGICAL UNIVERSITY

Similar documents
Microcontroller & Interfacing

GUJARAT TECHNOLOGICAL UNIVERSITY

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR. ELECTRONICS & COMMUNICATION DEPARTMENT Question Bank- 1


Microcontrollers. Fig. 1 gives a comparison of a microprocessor system and a microcontroller system.

Unit-I. 1. INTRODUCTION TO MICROCONTROLLERS. Micro controller, types, selection of a microcontroller and applications

Microcontroller and Embedded Systems:


GUJARAT TECHNOLOGICAL UNIVERSITY

Department of Electronics and Instrumentation Engineering Question Bank

DHANALAKSHMI COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING YEAR : III SEM : VI

VALLIAMMAI ENGINEERING COLLEGE

BHARATHIDASAN ENGINEERING COLLEGE. III Year / V Semester / EEE MICROPROCESSORS AND MICROCONTROLLERS (R-2013)

UNIT V MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS. 3.Give any two differences between microprocessor and micro controller.

Rewa Engineering College, Rewa. Rewa Department OF Electrical Engineering

Electrical Engineering

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

GUJARAT TECHNOLOGICAL UNIVERSITY

Microprocessor and Microcontroller question bank. 1 Distinguish between microprocessor and microcontroller.

8051 microcontrollers

MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller and Applications Subject Code:

Syllabus for Bachelor of Technology. Computer Engineering. Subject Code: 01CE0501. Subject Name: Microprocessor Fundamentals & Programming

Question Bank Microprocessor and Microcontroller

DEPARTMENT OF ECE QUESTION BANK SUBJECT: MICROPROCESSOR AND MICROCONTROLLER UNIT-1 PART-A (2 MARKS)

SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET

Pearson New International Edition. The 8051 Microcontroller and Embedded Systems Mazidi Mazidi McKinlay Second Edition

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

EC6504 MICROPROCESSOR AND MICROCONTROLLER QUESTION BANK UNIT I - THE 8086 MICROPROCESSOR PART A

BASIC INTERFACING CONCEPTS

INTRODUCTION OF MICROPROCESSOR& INTERFACING DEVICES Introduction to Microprocessor Evolutions of Microprocessor

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE:

2. List the five interrupt pins available in INTR, TRAP, RST 7.5, RST 6.5, RST 5.5.

Unit wise Question Bank UNIT-II

8051 Microcontrollers


CHAPTER 5 : Introduction to Intel 8085 Microprocessor Hardware BENG 2223 MICROPROCESSOR TECHNOLOGY

The Microcontroller. Lecture Set 3. Major Microcontroller Families. Example Microcontroller Families Cont. Example Microcontroller Families


8051 Microcontroller

Government of Karnataka Department of Technical Education Board of Technical Examinations, Bengaluru

INSTITUTE OF ENGINEERING AND MANAGEMENT, KOLKATA Microprocessor

ITT Technical Institute. ET2640 Microprocessors and Microcontrollers Onsite and Online Course SYLLABUS

EC 6504 MICROPROCESSOR AND MICROCONTROLLER

Microprocessors/Microcontrollers

Microprocessors and Interfacng. Question bank

Subject Code: Model Answer Page No: /25

QUESTION BANK CS2252 MICROPROCESSOR AND MICROCONTROLLERS

MICROCONTROLLER AND PLC LAB-436 SEMESTER-5

MICROPROCESSOR MICROPROCESSOR. From the above description, we can draw the following block diagram to represent a microprocessor based system: Output

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

WINTER 14 EXAMINATION Subject Code: Model Answer Page No: 1/ 26

History and Basic Processor Architecture

Introduction To MCS-51

VALLIAMMAI ENGINEERING COLLEGE. SRM Nagar, Kattankulathur DEPARTMENT OF COMPUTER SCIENCE ENGINEERING

3. (a) Explain the steps involved in the Interfacing of an I/O device (b) Explain various methods of interfacing of I/O devices.

AE66/AC66/AT66/ AE108/AC108/AT108 MICROPROCESSORS & MICROCONTROLLERS

MICROPROCESSORS & MICRO CONTROLLER COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK

QUESTION BANK. EE 6502 / Microprocessor and Microcontroller. Unit I Processor. PART-A (2-Marks)

1. Attempt any three of the following: 15

MLR INSTITUTE OF TECHNOLOGY DUNDIGAL , HYDERABAD

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad ELECTRONICS AND COMMUNICATION ENGINEERING QUESTION BANK

SRM UNIVERSITY FACULTY OF SCIENCE AND HUMANITIES DEPARTMENT OF PHYSICS AND NANOTECHNOLOGY COURSE PLAN FOR PHY0408

8051 Overview and Instruction Set

e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interfacing External Devices using Embedded C Module No: CS/ES/22

Write A General Form Of The Assembly

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

KINGS DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK. Subject Name: Microprocessors and Microcontrollers UNIT-I 8085 MICROPROCESSOR

1. Pin diagram of 8051 and ports

PART - B (Answer all five units, 5 X 10 = 50 Marks)

Mrs.T.Divya Barathi AP/ECE. Integrated Circuits Digital Logic Circuits Stack & Queue Concepts

EC2304-MICROPROCESSOR AND MICROCONROLLERS 2 marks questions and answers UNIT-I

Diploma in Embedded Systems

MICROPROCESSOR AND MICROCONTROLLER BASED SYSTEMS

Vidyalankar T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution

Scheme I. Sample Question Paper

PART B UNIT II PART A

B.C.A 2017 MICROPROCESSOR AND ASSEMBLY LANGUAGE MODULE SPECIFICATION SHEET. Course Outline

It is a program controlled semiconductor device (IC}, which fetches, decode and executes instructions.

EC6504 MICROPROCESSOR AND MICROCONTROLLER

GUJARAT TECHNOLOGICAL UNIVERSITY

Class: S.E. (Electrical) Course: 2012 PAT. Semester: IV : FUNDAMENTALS OF MICROPROCESSOR AND MICROCONTROLLER Textbooks:

acret Ameya Centre for Robotics & Embedded Technology Syllabus for Diploma in Embedded Systems (Total Eight Modules-4 Months -320 Hrs.

Three criteria in Choosing a Microcontroller

Module I. Microcontroller can be classified on the basis of their bits processed like 8bit MC, 16bit MC.

Lecture Note On Microprocessor and Microcontroller Theory and Applications

Vidyalankar T.E. Sem. V [EXTC] Microprocessors and Microcontrollers I Prelim Question Paper Solution V SS (GND)

Engr. A. N. Aniedu Electronic and Computer Engineering Nnamdi Azikiwe University, Awka

1. What is microprocessor? It is a program controlled semi conductor device (IC), which fetches, decodes and execute instructions.

Lecture 1. Course Overview and The 8051 Architecture

MODEL ANSWER WINTER 17 EXAMINATION Subject Title: Microcontroller and applications

S.R.M. INSTITUTE OF SCIENCE & TECHNOLOGY SCHOOL OF ELECTRONICS & COMMUNICATION ENGINEERING

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT IV I/O INTERFACING PART A (2 Marks)

Embedded World Television, Radio, CD player, Washing Machine Microwave Oven Card readers, Palm devices

Unit I. Introduction Microcontrollers and Embedded processors Overview of the 8051 Inside the 8051 Addressing Modes

SARDAR RAJA COLLEGES SARDAR RAJA COLLEGE OF ENGINEERING ALANGULAM

2. (2 pts) If an external clock is used, which pin of the 8051 should it be connected to?

FIFTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLOGY-MARCH 2014 EMBEDDED SYSTEMS (Common for CT,CM) [Time: 3 hours] (Maximum marks : 100)

Four Categories Of 8085 Instructions That >>>CLICK HERE<<<

Transcription:

GUJARAT TECHNOLOGICAL UNIVERSITY INSTRUMENTATION & CONTROL ENGINEERING (17) MICROCONTROLLER & INTERFACING (IC) SUBJECT CODE: 21517 B.E. 5 th SEMESTER Type of course: Core Engineering Prerequisite: 1. Fundamental of Digital Logic Design, Register array, flip-flops, counter.. 2. Decoder, Logic Gates, Number systems, etc. Rationale: This subject deals with how to control any external electronic device using programming and control it automatically and make it suitable for next stage of any measurement system. Teaching and Examination Scheme: Teaching Scheme Credits Examination Marks Total L T P C Theory Marks Practical Marks Marks ESE PA (M) ESE (V) PA (E) PA ALA ESE OEP (I) 4 0 2 6 70 20 10 20 10 20 150 Contents: S.N. Content Total Hrs % Weightage 1 Introduction to 8085 Micro processor Basic ideas about:- Micro processor definition, Machine language, Assembly language, Lower level languages, Higher level languages, Interpreter, Compiler, Example and basic block diagram of computer with the micro processor as CPU(ALU+CU). 2 4 2 8085 Microprocessor Architecture and Memory interfacing Microprocessor Bus organization:- The 8085 Bus structure block diagram, Explanation of Address bus, Data bus, Control bus, RD, WR, MEM,I/O signals. Memory:- Definition of memory, Explanation about Program memory (code memory/ ROM), Read/write memory (RAM). Latches as a storage element: Diagram of four latches as a 4-bit register, Explanation how 4 nit register store data using RD, WR and enable signal. Diagram of 4X8 Bit register, How address and command signal is given to 4X8 bit register memory Memory and Instruction Fetch:- 2.3.1. Instruction fetch Diagram, Explain Program Counter register, Stack Pointer, Register array bank, Control Unit, ALU. 2.3.2 Explanation of steps to perform instruction fetching operation from memory to Microprocessor, working of control signal, data bus, address bus, internal data bus, instruction decoder and ALU. 2.3.3. Introduction to Microcomputer system block diagram 4 8

3 Microprocessor Memory interfacing and Timing Cycles 8085 Microprocessor Pin out and signal diagram Higher address bus, Lower address and data bus, ALE, RD, WR, IO/M, VCC, VSS, X1,X2 pins, Clock frequency of 8085 De-multiplexing of the Address and data Bus AD7 - AD0, Role of ALE. Generation of control signals MEMR, MEMW, ID, and IOWR. Timing cycles:- Definition of T-state, Machine cycle, Instruction cycle Timing cycle to transfer of byte(ex. mov C,A) from memory to MPU, Role of ALE, Role of IO/M, RD and WR. Timing Cycle of any two byte data transfer instruction(ex. MVI A, 32H) Memory Interfacing with 8085:- Basic concept of Memory interfacing, concept of Chip select pin, Address decoding techniques (Ex. Using NAND gate, Decoder etc..), Memory address selection according to size of memory chip,. Example of interfacing different size of ROM, EPROM with 8085 Microprocessor. Example of interfacing different size of RAM with 8085 Microprocessor. 4 Introduction & architecture of 8051 Micro controller Definition of Micro controller, Difference between Microprocessor and Microcontroller, Block diagram of 8051 Microcontroller, over view of 8051 family 4 8 2 4 8051 Microcontroller Architecture Architecture of 8051 Microcontroller, The program counter and ROM space in the 8051, 8051 flag bits and the PSW register, 8051 register banks, stack and RAM Space. 5 8051 Assembly Language Programming: Introduction to 8051 assembly programming, Structure of Assembly language, Assembling and running an 8051 program, 8051 data types and directives Jump, Loop, And Call Instructions: Loop and jump instructions, Call instructions time delay for various 8051 chips 6 8051 Addressing Modes: Immediate and register addressing modes, Accessing memory using various Addressing modes, Bit addresses for I/O and RAM, Extra 128-byte on-chip RAM in 8052. 7 Arithmetic and Logic Instructions and Programs: Arithmetic instructions, Signed number concepts and arithmetic operations, Logic and compare instructions, Rotate instruction and data serialization, BCD, ASCII, and other application programs. 8 I/O Port Programming and Seven Segment Display: 8051 I/O programming, I/O bit manipulation programming. Internal Structure of ports Introduction to seven segment display, common cathode and common anode seven segment display Interfacing of seven segment display with 8051 and programming to display from 0 to 9 at every second using loop. Interfacing of push button and SPST switch with 8051 ports. Introduction to key bouncing and de-bouncing techniques. Write a program to interface 8 SPST switch and one seven segment display with 8051 and display the number of switch whichever is presses at a time on seven segment display Generation of square wave on port pin with different duty cycle using loop. 3 6 3 6 2 4 5 10

9 8051 Programming in C: Data types and time delay in 8051 C, I/O programming in 8051 C, Logic operations in 8051 C, Data conversion programs in 8051 C, Accessing code ROM space in 8051 C, Data serialization using 8051 C. 10 8051 Hardware Connection and Intel Hex File: Pin description of the 8051, Design and test of 8051 Minimum Module, Explaining the Intel hex file. 11 8051 Timer Programming in Assembly and C: Programming 8051 timers, Counter programming, Programming timers 0 and 1 in 8051 C. 8051 Serial Port Programming in Assembly and C: Basics of serial communication, 8051 connection to RS232, 8051 serial port programming in Assembly, Programming the second serial port, Serial port programming in C. Interrupts Programming in Assembly and C: 8051 interrupts programming, Timer interrupts, Programming external hardware interrupts, Programming the serial communication interrupt, Interrupt priority in the 8051/52, Interrupt programming in C. 12 LCD and Keyboard Interfacing: LCD interfacing in Assembly and C. Keyboard interfacing in Assembly and C. 2 4 2 4 9 16 6 10 ADC, DAC Parallel ADC 08 and 0808 interfacing with 8051 Parallel DAC 0808 interfacing with 8051, converting I out Generation of sine wave using DAC0808. to voltage in DAC0808, 13 8051 Interfacing to External Memory: Memory address decoding, 8031/51 interfacing with external ROM, Flash RAM, 8051 data memory space, Accessing external data memory in 8051 C. 8051 interfacing with 8255 Programming the 8255, 8255 interfacing, 8051 C programming for 8255 14 Motor Control: PWM, DC and Stepper Motors: Generation of PWM signal using timer in Assembly or C language Interfacing of DC motor with 8051 and control it s speed and direction using PWM Interfacing of Stepper motor with 8051 4 8 4 8 Suggested Specification table with Marks (Theory): Distribution of Theory Marks R Level U Level A Level N Level E Level C Level 14 21 14 14 7 - Legends: R: Remembrance; U: Understanding; A: Application, N: Analyze and E: Evaluate C: Create and above Levels (Revised Bloom s Taxonomy) Note: This specification table shall be treated as a general guideline for students and teachers. The actual distribution of marks in the question paper may vary slightly from above table.

Text Books: 1. Microprocessor Architecture, Programming and Applications with the 8085 by Ramesh Gaonkar(Fifth Edition). 2. The 8051 Microcontroller and Embedded Systems Using Assembly and C, 2/e by Muhammad Ali Mazidi, Janice Gillispie Mazidi and Rolin McKinlay ( Second Edition, Pearson Education ). 3. The 8051 Microcontroller & Embedded Systems using Assembly and C By K. J.Ayala, D. V. Gadre (Cengage Learning, India Edition). 4. 8051 Microcontrollers: MCS51 family and its variants by Satish Shah, Oxford University Press. 5. 8051 Microcontroller: Internals, Instructions, Programming and Interfacing by Subrata Ghoshal, Pearson Education. 6. The 8051 Microcontrollers: Architecture, Programming and Applications by K Uma Rao, Andhe Pallavi, Pearson Education. Reference Books: 1. INTEL Manual: MCS-51 Architecture. 2. Philips Data Handbook, I2C Peripherals. 3. IEEE Standards, Low Rate Wireless Personal Area Networks, 2003. Course Outcome: 1. After learning the course the students should be able to design a mini computer system. 2. Students should be able to do programming for general purpose automation. 3. Students should be able to make different displays, control dc motor speed control, interfacing memory with micro controller. 4. Student can make their own automation projects which may be useful in day to day life and helps to make human life better. List of Experiments and Design based Problems (DP)/Open Ended Problem: Assembly and C language programming for the 8051 Microcontroller 1) a) Write a program to add and subtract two 8-bit numbers stored in registers or internal/external memory locations. b) Write a program to multiply and divide two 8-bit numbers stored in registers or memory locations. c) Write a program to perform 16-bit addition and multiplication. 2) a) Write a program to add block of data stored in internal/external memory locations. b) Write a program to transfer block of data from internal memory locations to external memory locations. 3) a) Write a program to find maximum and minimum number from given data series b) Write a program to sort block of data in ascending or descending order. 4) Write a program to count the number of even numbers, odd numbers and zeroes from given data series 5) Write a program to generate Fibonacci series and store them to internal memory location 6) Write a program to compare a password (two data string ). 7) a) Write a program to perform the following. 1. Keep monitoring P1.2 until it becomes high. 2. When P1.2 becomes high write value 45H on P0. 3. Sent a high to low pulse to P2.3 b) A switch is connected to P1.7. Write a program to check the status of switch and perform the following. 1. if switch = 0, send letter N to P2 2. if switch = 1, send letter Y to P2. 8) a) Write a program to generate 5 KHz pulse waveform of 50% duty cycle on pin 1.0 using timer 1 in mode 2.

b) Write a program to generate 1 KHz pulse waveform of 70% duty cycle on pin 1.0 using timer. 9) a) Write a program for the 8051 to transfer letter A serially, continuously. b) Write a program to transfer the message YES serially. Do this continuously. c) Program the 8051 to receive bytes of data serially, and put them in P1. 10) Interfacing ADC and DAC. 11) Interfacing Matrix Keyboard. 12) Interfacing LED and LCD Displays. 13) Interfacing Stepper Motor. 14) Controlling DC motor using PWM. Microcontroller Interfacing Miniproject based on 8051 family microcontroller in a group of 2 to 3 students is mandatory. Practical number 1 to 5 is programmed in assembly language as well as in embedded C. Major Equipment: Microcontroller kits, IC programmer, IC tester, Bread board trainenr, Power Supply, Function generator, DSO, Special purpose ICs. List of Open Source Software/learning website: http://www.onlinevideolecture.com/electrical-engineering/nptel-iit-kharagpur/industrialinstrumentation/?course_id=514 https://www.8051.com ACTIVE LEARNING ASSIGNMENTS: Preparation of power-point slides, which include videos, animations, pictures, graphics for better understanding theory and practical work The faculty will allocate chapters/ parts of chapters to groups of students so that the entire syllabus to be covered. The power-point slides should be put up on the web-site of the College/ Institute, along with the names of the students of the group, the name of the faculty, Department and College on the first slide. The best three works should submit to GTU.

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER V (NEW) - EXAMINATION SUMMER 2017 Subject Code: 21517 Date: 05/05/2017 Subject Name: Microcontroller and Interfacing Time: 02:30 PM to 05:00 PM Total Marks: 70 Instructions: 1. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. 4. Consider crystal frequency of 12MHz for microcontroller 8051 if not specified. 5. Comment lines are must in assembly and C programs. Q.1 Short Questions 14 1 To mask certain bits we must AND them with. 2. What is the purpose of EA pin in microcontroller 8051? 3 When LCALL is executed, how many bytes of the stack are used? 4 What is the function of DPTR in microcontroller 8051? 5 What is the difference between 8031 and 89C51 microcontrollers? 6 What are the conditions for setting the OV flag? 7 What is the difference between a timer and a counter? 8 What is the difference between MOVC and MOVX? 9 instructions? What precaution we should take before using SUBB instruction? 10 What is the function of GATE bit in TMOD SFR? 11 Write instruction(s) to select register bank 3. 12 What is the function of ALE signal in microprocessor 8085? 13 What do you mean by indirect addressing mode? 14 takes more ROM space in 8051. (SJMP,LJMP,JNC) Q.2 (a) Explain bitwise shift operators in C with appropriate example of each. 03 (b) Exchange lower nibbles of R1 and internal RAM 42H without using logical instruction. (c) Interface a seven segment common anode display with microcontroller 8051. Write an 8051 assembly language program to display numbers from 0 to 9 at every second using loop. (c) Write an 8051 assembly language program to convert a binary number stored in external RAM address 2000H, into its equivalent BCD code. Store BCD code in internal RAM address beginning from 30H. Q.3 (a) List and explain generation of control signals for memory and 03 input/output devices for read and write operations in microprocessor 8085. (b) With the help of neat diagram explain demultiplexing in microprocessor 8085. (c) Interface (i) 32K EPROM and (ii) 8K RAM memories with microcontroller 8051. Write memory address ranges and draw the complete interface diagram. Q.3 (a) Draw the neat diagram of internal memory organization of microcontroller 8051. 03 (b) What is Assembler directive? Explain assembler directives G and EQU with example. 1

(c) Interface (i) 8K EPROM and (ii) 4K RAM memories with microprocessor 8085. The EPROM address should begin from 0000H and the RAM address should begin at 8000H. Write memory address ranges and draw the complete interface diagram. Q.4 (a) Interface DAC 0808 with microcontroller 8051. 03 (b) Write a C program to generate a sawtooth wave using the DAC. (c) Using timer0 of microcontroller 8051 in mode 1, generate a square wave with an ON time of 3 ms and an OFF time of 10 ms on all pins of port 1. Assume crystal frequency of 12 MHz Show your delay calculations. Q.4 (a) Draw interfacing diagram of 8255 with microcontroller 8051 so that the 03 addresses for Port A, Port B, Port C and Control Word Register are 4000H, 4001H, 4002H and 4003H respectively. (b) Assume 8255 is connected with microcontroller 8051 and four switches are connected to port lines PA0-PA3. Write a program to transfer the status of these switches to LEDs connected to upper 4-bits of Port B. Assume port addresses specified in Q.4(a). (c) Generate a square wave of frequency 2 KHz on pin P1.3 assuming crystal frequency of 12 MHz. Show your delay calculations. Q.5 (a) Draw interfacing circuit of DC motor with microcontroller 8051. 03 (b) How can we control the speed and direction of DC motor using PWM? (c) Write a C program that continuously gets a single bit of data from P1.5 and sends it to P1.2, while simultaneously creating a square wave of 500 µs period on pin P2.4. Use timer 0 to create the square wave. Assume crystal frequency of 12 MHz. Show your delay calculations. Q.5 (a) Draw interfacing circuit of LCD with microcontroller 8051. 03 (b) Write an 8051 C program to toggle bit D2 of the port P1 (P1.2) 20,000 times. (c) Write an 8051 assembly language program to receive the data which has been sent in serial form and send it out to port 2 in parallel form. Also save the data at internal RAM location 50H. ************* 2

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER V (NEW) - EXAMINATION SUMMER 2016 Subject Code:21517 Date:21/05/2016 Subject Name:Microcontroller & Interfacing (IC) Time:02:30 PM to 05:00 PM Total Marks: 70 Instructions: 1. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. 4. Consider crystal frequency of 12MHz for microcontroller 8051 if not specified. 5. Comment lines are must in assembly and C programs. 4. Q.1 (a) Interface 8 SPST switches (number 0 to 7) to port 1 and seven segment common anode display to port 2. Write an 8051 assembly language program to display the number of switch which is pressed at a time on seven segment display. (b) Write an 8051 C program to toggle LED connected to port P2.2 every 500 msec. Stop toggling after 15000 such toggles (on-off means one toggle). Q.2 (a) Two 16 bit BCD numbers are stored in registers R0 (LSB)-R1 and R2 (LSB)- R3. Add these numbers and store the BCD result in external RAM 2000H (LSB) onwards. (b) List different addressing modes of microcontroller and explain each of them with appropriate example. (b) (i) Discuss various C data types for the 8051 microcontroller. (ii) Draw circuit diagram of XTAL connection and power on RESET circuits for the 8051 microcontroller. Q.3 (a) Write an 8051 assembly language program to generate a square wave of 50Hz, 25% duty cycle on the P1.7 pin using timer 0. Show your delay calculations assuming crystal frequency of 12MHz. (b) Write an 8051 assembly language program to toggle LED every 500 msec, which is connected to pin P1.5. Use timer 1 interrupt in your program. (No credit/mark will be given without interrupt) Q.3 (a) Write a C program for 8051 to transmit the message GTU serially at 4800 baud rate continuously using 8-bit data and 1 stop bit. (b) Connect a switch to INT0 interrupt pin and LED to P1.3 of microcontroller 8051. Write an assembly language program to toggle LED when switch is not pressed. Stop the toggling and put LED in ON status if switch is pressed. Keep this continuously. Make use of interrupt in your program. (No credit will be given without interrupt) Q.4 Draw interfacing circuit of LCD with microcontroller 8051. Explain the function of each pin and register of LCD. Write an 8051 C program to display message CLEAN INDIA on LCD using busy flag method. 03 14 1

Q.4 Interface 4x4 matrix keyboard with 8051 microcontroller. Draw flowchart and write an assembly language program to detect the pressed key and store its corresponding ASCII value in external RAM location 3000H. Q.5 (a) Interface 8255 with microcontroller 8051 in which port A address is 3000H. What are the addresses of other ports in your interfacing? Write an 8051 assembly language program to get data from port A and display its complement on port B. (b) Draw and explain timing diagram of MOV C, A instruction of microprocessor 8085. Q.5 (a) Interface stepper motor and one switch with microcontroller 8051. Write an assembly or C program to rotate it in clockwise if switch is pressed (i.e. 1), else rotate it in anticlockwise direction. (b) What is the need of demultiplexing in microprocessor 8085? With the help of neat diagram explain the same in detail. 14 ************* 2

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE SEMESTER V (NEW) EXAMINATION WINTER 2015 Subject Code: 21517 Date:17/12/ 2015 Subject Name: Microcontroller & Interfacing Time: 10:30am to 1:00pm Total Marks: 70 Instructions: 1. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. Q.1 (a) Compare the following: (i) Microprocessor and Microcontroller (ii) Absolute address decoding and Partial address decoding (b) (i) Define: T-state, Machine cycle and Instruction cycle. (ii) Explain with neat sketch how lower order address is demultiplexed in 8085. Q.2 (a) Interface the following memories with 8085: (i) 2K EPROM (ii) 2K RAM. The EPROM address should start from 0000H and the RAM address should begin at 4000H. Draw the complete interface diagram. (b) Describe 8051 architecture with Block diagram. (b) (i) Draw 8085 Bus structure. (ii) Explain in brief how four latches are configured as 4-bit registers. Q.3 (a) Describe in detail the various addressing modes and assembler directives supported by 8051 microcontroller with suitable examples. (b) Write an assembly language program to convert a given binary number into its equivalent BCD code. Eg. FF H = 255 d. Q.3 (a) 8-SPST switches are connected to Port-3 of 8051. Assume that one of the switches is pressed. Write a program to display the no. of switch pressed on seven segment display which is connected to Port 1. (b) Draw the structure of SCON register and explain the importance of each bit. Write a C-program to transfer letter M serially at 4800 baud continuously. Q.4 (a) Assuming that XTAL = 22 MHz, write an assembly language program to generate a square wave of frequency 1 KHz on pin P1.3. (b) Mention the various interrupts available in 8051. Explain in detail the IE(Interrupt Enable) register and IP(Interrupt Priority) Register. Q.4 (a) Draw and explain 8051 connections with MAX-232 and DB-9 connector. (b) Describe in brief the different modes in 8255. Assume 8255 is connected with 8051 so that the addresses for Port A, Port B, Port C and Control Word Register are 4000H, 4001H, 4002H and 4003H respectively. Four switches are connected to lower 4-bit lines PB0-PB3. Write a program to transfer the status of these switches to LED s connected to upper 4-bits of Port A. Q.5 (a) Interface 16x2 LCD with 8051. Write a C-program to display WINTER EXAM 2015, continuously. (b) Explain with a neat sketch how a stepper motor is connected with 8051. Also write a C code to rotate it continuously. 03 03 03 1

Q.5 (a) Show 8051 connections with 4x4 Matrix Keyboard. Explain with the help of flow chart the logic to identify the key pressed. (b) Show 8051 connections with DAC 0808. Write a C-program to generate a sine wave using the same. ************* 2