0% found this document useful (0 votes)
36 views20 pages

EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021

Uploaded by

dk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views20 pages

EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021

Uploaded by

dk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 20

EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021

EC8691-MICROPROCESSOR AND MICROCONTROLLER

UNIT I THE 8086 MICROPROCESSOR


PART-A
1. What are the types of instruction sets of 8086 microprocessor?
There are eight types of instructions. Data copy/Transfer instructions, Arithmetic &
Logical instructions, Branch instructions Loop instructions, Machine control instructions,
Flag manipulation instructions Shift & rotate instructions, String instructions

2. What are flag manipulation instructions?


The instructions that directly modify the flags of 8086 are called as the flag
manipulation instructions. E.g.: CLC -clear carry flag, CMC - complement carry flag, STC-
set carry flag and CLD- clear direction flag

3. Write a program to generate a delay of 100 ms using 8086.


MOV CX, COUNT 4 states
L1 : DEC CX ` 2 states
NOP 3 states
JNZ L1 16 states
No. of clock cycles for execution of the loop once =2+3+16 = 21
Time required to execute the loop once is 21*.1=2.1 micro sec.
COUNT=required delay (td), N* T
Required count = 100*10^-3
2.1*10^6 = 47.619*10^3 = 47619 = BA03

4. Given that (BX)=1058 (DI)=10A5 displacement=1B57 (DS)=2100.Determine the


effective address and physical address for the following addressing modes. A)register
indirect b) relative based indexed.(MAY 2019)
a) Register indirect: Effective address =BX+DI= 20FD
Physical Address=DS*10+BX=22058
b) Relative base index: effective address = BX+DI + displacement=2BAF
Physical Address= DS * 10H + BX + DI + displacement=24C54

5. Define a MACRO. (Nov 2017, May2019)


A number of instructions appearing again & again in the main program can be
assigned as a macro definition (i.e.) a label is assigned to the repeatedly appearing string of
instructions.
The process of assigning a label or macro name to the string is called defining a macro. A
macro within a macro is called a nested macro.

6. What are the segment registers present in 8086? (Nov 2016)


There are four segment registers in 8086.They are Code Segment register (CS), Data
Segment register (DS), Extra Segment register (ES), Stack Segment register (SS).

7. What are the advantages of the segmented memory scheme in 8086?


1) Allows the memory capacity to be 1 Mbytes although the actual addresses to be
handled are of 16-bit size.
2) Allows the placing of code, data and stack portions of the same program in different
parts of memory, for data and code protection.
3) Permits a program and/or its data to be put into different areas of memory each time
program is executed.

1
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021
8. What do you mean by addressing modes? What are the addressing modes of
sequence control transfer instructions in 8086? Give example. (May 2014) (May 2018).
Addressing modes indicate a way of locating data or operands.
Immediate eg: Mov AX, 0005H,
Direct eg: Mov AX, [5000H],
Register eg:Mov BX,AX,Register
Indirect eg:Mov AX,[Bx],
Indexed eg: Mov AX,[SI],
Register Relative eg:Mov AX,50H[BX],
Based Indexed eg: Mov AX, [Bx] [SI],
Relative Based Indexed eg: Mov AX, 50H [BX] [SI].

9. How is the physical address generated in 8086? (or) How 16 bit address is converted
into 20 bit address in 8086? (Nov 2013)
The content of the segment register called as segment address is shifted Left bit-wise
four times and to this result, content of an offset register also called as offset address is
added, to produce a 20-bit physical address.
eg: segment address 1005H
Offset address 5555H
Segment address 0001 0000 0000 0101
Shifted by 4 bit positions 0001 0000 0000 0101 0000
+
Offset address 0101 0101 0101 0101
Physical address 0001 0101 0101 1010 0101
Total = 1 5 5 A 5

10. What are the differences between 8085 and 8086? (Nov 2013)
S.No 8085 8086
1 8-bit microprocessor 16-bit microprocessor
2 It is capable of addressing 216 memory It is capable of addressing 220 memory
locations locations
3 Low speed High speed
4 It can be configured only in single It can be configured in single processor
processor mode mode (Minimum) and Multiprocessor
mode (Maximum)

11. Explain XLAT instruction.


 The XLAT (Translate) instruction replaces a byte in the AL register with a byte from a
256-byte, user coded translation table.
 XLAT is useful for translating characters from one code to another like ASCII to EBCDIC
and ASCII to HEX etc.

12. Draw the PSW format for 8086 / List the flags in 8086 and state its functions. (May
2014, 2016, Nov 2016, Nov 2017, May 2019).
B15 B14 B13 B12 B11 B10 B9 B8 B7 B6 B5 B4 B3 B2 B1 B0
U U U U OF DF IF TF SF ZF U AF U PF U CF
U : Undefined
CF : Carry flag - Set by carry out of MSB
PF : Parity flag - set if result has even parity
AF : Auxiliary carry flag - used for BCD operation
ZF : Zero flag - set if result = 0
2
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021
SF : Sign flag - set if result is negative value.
TF : Trap flag - set to enable single step execution mode.
IF : Interrupt flag - set to enable interrupt
DF : Direction flag - set to enable auto decrement mode for string operation
OF : Overflow flag - used for signed arithmetic operation

13. What is the function of parity flag? (Nov 2013)


The parity flag is used to indicate the number of ones in the result stored in the
accumulator. If PF=1, odd parity; PF=0, even parity

14. Give the operation of CBW and TEST instructions of 8086? (Nov 2013)
CBW instruction converts the byte in AL to word value in AX by extending the sign
of AL throughout the register AH. TEST instruction performs logical AND operation of the
two operands updating the flag registers without saving the result.

15. What is meant by a vectored interrupt? (May 2014)


The interrupt vector table stores the location of interrupt service routine (ISR) of
various interrupts. Whenever an interrupt occurs the memory location of ISR is determined
using the vector table and the program control branches to ISR after saving the flags and the
program location (Instruction Pointer and Code Segment Register) in the stack.

16. Identify the addressing modes in the following instructions. (May 2014)
AND AL, BL : Register Addressing Mode
SUB AL, 24H : Immediate Addressing Mode
MOV AL, (BP) : Indirect Addressing Mode
MOV CX, 1245H : Immediate Addressing Mode

17. What is an assembler? (Nov 2014)


The assembler translates the assembly language program text which is given as input
to the assembler to their binary equivalents known as object code. The time required to
translate the assembly code to object code is called access time. The assembler checks for
syntax errors & displays them before giving the object code.

18. Calculate the physical address, when segment address is 1085 H and effective
address is 4537 H. (Nov 2015)
Physical address= 10* 1085 H + 4537 H = 14D87 H

19. Show how the 2 byte INT instruction can be applied for debugging. (Nov 2015)
INT 1 is called as single-step interrupt. When microprocessor executes INT 1
instruction, it will execute one instruction and stop. Then, it goes and examines the contents
of registers and memory locations. If the contents are correct, the microprocessor executes
the next instruction. INT 3 is called as break point interrupt. This is used to insert break
points for debugging the program. The microprocessor executes the program up to the break
point and then branches to break point Interrupt service routine(ISR).

22. Define Stack and stack pointer? (May 2016, May 2017, May 2018)
A stack pointer is a small register that stores the address of the last program request in
a stack. A stack is a specialized buffer which stores data from the top down. As new
requests come in, they "push down" the older ones.

23. The offset address of a data is (341B)H and the data segment register value is
(123A)H. What is the physical address of the data? (May 2017)
The physical address of data can be given as (123A0)H+(341B)H = (157BB)H

3
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021
24. What is the need for interrupts in microprocessor operation? (Nov 2018)
Interrupt is the method of creating a temporary halt during program execution and
allows peripheral devices to access the microprocessor. The microprocessor responds to that
interrupt with an ISR (Interrupt Service Routine), which is a short program to instruct the
microprocessor on how to handle the interrupt.

25. What are byte and string manipulation? (Nov 2018)


Operations such as move, scan, store, load, compare performed on strings is called
string manipulation. Byte instructions are used to perform operations where data bits are
involved.

26. What is meant by instruction Queue?


It is of 6 bytes length which is used to speed up execution of programs by pre-fetching
six bytes of instruction in advance from the memory.

27. Write a 16 bit delay program in 8086. (May 2017, May 2018)
DELAY: MOV DX,0FFFFH
LOOP1: DEC DX
JNZ LOOP1.

PART-B
1. Explain the internal architecture of 8086 and explain the functions of each block in
detail.
(May 2018, May 2016, May 2017, Nov 2017, 2018 and May 2019)
2. Write an 8086 ALP to logically shift a 16 bit number stored in location starting at
8000H twice to the right. Store the result in A000 H.
3. Explain the different instruction used for input and output operation in I/O mapped I/O
mode of 8086.
4. Explain the register organization of the 8086. Discuss how the physical address
generation is carried out.
5. What is meant by memory segmentation? What are the advantages of memory
segmentation?
6. Write an 8086 ALP to sort out any given ten numbers in ascending and descending
order.
(Nov 2013)
8.With a neat diagram explain the bus interfacing unit and execution unit available in 8086
microprocessor. (Nov 2014, May 2014).
9.(i) Briefly explain the arithmetic group of instructions available in 8086 microprocessor.(8)
(ii) Briefly explain the assembler directives of 8086. (8) (Nov 2014, 2016 , 2018).
10. Briefly describe about addressing modes of 8086. (8) (Nov 2014, 2015, 2016, 2018)
11.Explain in detail about the interrupts and interrupt service routine of 8086.Explain
interrupt sequence for 8086 (16) (May 2016, Nov 2017, 2018, 2019)
12. Explain the Data transfer, arithmetic and branch instructions with examples. (May 2016)
13. Write an 8086 ALP to find the sum of numbers in an array of 10 elements.(May 2016)
14. What are the instruction set and assembler directives in 8086? Explain. (Nov 2018)

4
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021

UNIT-II 8086 SYSTEM BUS STRUCTURE


PART – A
1. What is meant by multiprocessor system?
If a microprocessor system contains two or more components that can execute
instructions independently then the system is called as multi-processor system.

2. What is closely coupled configuration?


If the processor supporting processor, clock generator, bus control logic, memory and
I/O System, communicate shared memory then it is called closely coupled system.

3. Write the advantages of loosely coupled configuration over tightly coupled?(May


2019)
1. Better system throughput by having more than one processor
2. A greater degree of parallel processing can be achieved
3. System structure is more flexible
4. A failure in one module does not cause any breakdown of the system.

4. What is a bus? Explain its types. (Nov 2016)


A bus is defined as a group of separate wires which work together to perform a
particular task.
Address bus: a group of wires which selects the address of the source/destination for the data
transfer. The address bus is an output from the microprocessor.
Data bus: a bi-directional group of wires used to transfer between the source and destination,
one of which will normally be the microprocessor.
Control bus: a miscellaneous group of wires which is responsible for controlling and
synchronizing the data transfer process.

5. Differentiate internal Vs external bus? (May 2016)


An internal bus or local bus and an external bus, also called the expansion bus. An
internal bus enables communication between internal components such as a video card
and memory. An external bus is capable of communicating with external components such as
a USB or SCSI device.

6. Compare closely coupled and loosely coupled configurations. (May 2016)


Closely coupled: Here, the microprocessors share a common clock and bus control
logic. Loosely coupled: Here, each CPU may have its own bus control logic.

7. What is meant by bus arbitration?


The mechanism which decides the selection of current master to access bus is known
as bus arbitration.

8. What are the advantages of Daisy Chaining?


1. It is simple and cheaper method, 2. It requires the least number of lines and this
number is independent of the number of masters in the system

9. On which data types can memory operands operate?


Word integer, Short integer, Long integer, Packed BCD, Short real and Long Real.

10. What is a co-processor? (Nov 2013, Nov 2018)

5
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021
The 8086 must be supplemented with co-processors that extend the instruction set to
allow the necessary special computations to be accomplished more efficiently. Eg: 8087
Numeric Data Processor.

11. What is a Floating point Coprocessor? (Nov 2013)


The floating point coprocessor uses real data types or floating point types of the
following format: Real data X=±2exp×mantissa, which may vary from extremely small to
extremely large values.

12. What are advantages of coprocessor? (May 2014)


The math co-processor can perform complicated numeric calculations in
comparatively less time. The I/O co-processor takes care of the I/O activities of the system
and saves time of the main processor.

13. What is meant by loosely coupled configuration? (May 2014)


In a loosely coupled multiprocessor system each CPU has its own bus control logic
and bus arbitration is resolved by extending this logic and adding external logic that is
common to all the modules.

14. Explain the function of TEST pin in 8086


This input is examined by a “WAIT” instruction. When the processor executes WAIT
instruction it enters into wait state (Idle state). If the TEST pin goes low, the processor will
come out from the idle state and continues the execution; otherwise it remains in an idle state.

15. Define system bus? (Nov 2018)


A system bus is a single computer bus that connects the major components of a
computer system, combining the functions of a data bus to carry information, an
address bus to determine where it should be sent, and a control bus to determine its operation.

16. What is multi programming? (Nov 2015, May 2017, May 2018)
Multiprogramming is a rudimentary form of parallel processing in which several
programs are run at the same time on a uniprocessor. Since there is only one processor, there
can be no true simultaneous execution of different programs. Instead, the operating system
executes part of one program, then part of another, and so on. To the user it appears that all
programs are executing at the same time.

17. Schematically show, how synchronization is made between 8086 and its co-
processor.
(Nov 2015)
Coprocessors are unable to work independently as they are unable to fetch the code
from memory and thus they work under the control of the main processor. Additional
hardware elements like bus controllers and bus arbiters are used to coordinate the activities of
the number of coprocessors working at a time in the system.

18.What is machine cycle? (Nov 2016)


6
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021
It is the time required by the microprocessor to complete the operation of accessing
the memory devices or I/O devices. In machine cycle various operations like opcode fetch,
memory read, memory write, I/O read, I/O write are performed.

19. Write some example for advanced processors. (May 2017, Nov 2017)
Some of the advanced processors can be given as Intel 80286,80386,80486, ARM
processors, SHARC processors.

20. What is the need of LOCK Signal? (Nov 2017)


It indicates to another system bus master, not to gain control of the system bus while
LOCK is active Low. The LOCK signal is activated by the "LOCK" prefix instruction and
remains active until the completion of the instruction. This signal is active Low and floats to
tri-state OFF during 'hold acknowledge.

21. List two differences between maximum mode and minimum mode. (May 2018)
Minimum mode Maximum mode
In minimum mode there can be only one In maximum mode there can be multiple
processor i.e. 8086. processors with 8086, like 8087 and 8089.
ALE for the latch is given by 8086 as it is ALE for the latch is given by 8288 bus
the only processor in the circuit. controller as there can be multiple
processors in the circuit.
PART-B
1. Explain the closely coupled configuration of multi-processor configuration with suitable
diagram. (May 2014, May 2017)
2. Explain in detail about system bus timing of 8086/8088.(Nov 2016, May2016)
3. Explain the maximum mode and minimum mode of operation of 8086. Explain the
functions of various signals used in these modes.(Nov 2015)
4. Differentiate closely coupled configuration and loosely coupled configuration. (Nov
2013, Nov 2018)
5. (i) Draw the pin details of 8086 and explain the function of each pin. (ii) Give the
functions of NMI, BHE and TEST pins of 8086. (4) (Nov 2013)
6. Define loosely coupled system. Explain the schemes used for establishing priority.
(16) (Nov 2015)
7. Explain the following:(i) Multiprocessor system (ii) Coprocessor (iii) Multiprogramming
(iv) Semaphore (May2016)
8. Discuss about the multiprocessor configuration of 8086?(Nov 2016,May 2018)
9. Explain the system bus structure of 8086. Draw the timing diagram for interrupt
acknowledgement cycle. (May 2017, Nov 2017,Nov 2018)
10. Explain the loosely looped configuration with neat diagram. (Nov 2017)
11. With neat diagram explain the architecture of 8086 in maximum mode configuration.
Also explain the bus timing diagram for input and output transfer on maximum mode.(May
2019)

7
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021

UNIT-III I/O INTERFACING


PART –A
1. Give the various modes of 8254?(May 2018)
Mode 0 (Interrupt on Terminal Count) , Mode 1 (Hardware Retriggerable One Shot),
Mode 2 (Rate Generator) , Mode 3 (Square Wave Generator) , Mode 4 (Software Triggered
Strobe), Mode 5 (Hardware Triggered Strobe)

2. Name the major blocks of 8259 Programmable Interrupt Controller.


Interrupt service reg, Priority resolver, Interrupt Request Register and Interrupt Mask Reg

3. What are the modes of operation of 8259 interrupt Controller?


Fully Nested, Special Fully, Rotating Priority, Special masked and Polled Modes

4. What is mode 0 operation of 8255?(May 2019)


Mode 0 – Simple or basic I/O Mode: In this mode ports A, B and C can be used in
input or output mode. The outputs are latched, but inputs are not latched. This mode has
interrupt handling capability.

5. What are the differences between LED and LCD display?(Nov 2018)
LED LCD
PN-Junction device which discharge visible It is an optical device used for displaying the
lights when an electrical charge passes information in the form of text and images.
through it.
No backlight Cold cathode fluorescent lamp provides
backlight.

6. What is Key bouncing? What are the methods to detect the debouncing? (May
2016).
Whenever a mechanical push-button is pressed or released once, the mechanical
components of the key do not change the position smoothly, rather it generates a transient
response. These transient variations may be interpreted as the multiple key pressures and
responded accordingly by the microprocessor system. To avoid this problem, two schemes
are suggested: the first one utilizes a bistable multivibrator at the output of the key to
debounce. The other scheme suggests that the microprocessor should be made to wait for the
transient period (usually 10ms), so that the transient response settles down and reaches a
steady state.

7. Why is memory interfacing required?(Nov 2018)


When we are executing any instruction, we need the microprocessor to access the
memory for reading instruction codes and the data stored in the memory. For this, both the
memory and the microprocessor require some signals to read from and write to registers. The
interfacing circuit therefore should be designed in such a way that it matches the memory
signal requirements with the signals of the microprocessor.

8. What are the modes in DMA?


Single Transfer Mode, Block Transfer Mode, Demand Transfer Mode, Cascade Mode

9. How is DMA initiated? Or How DMA operation is performed with 8086. (Nov 2017).
The 8086 microprocessor receives bus requests through its HOLD pin and issues
grants from the hold acknowledge (HLDA) pin. A request is made when a potential master
8
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021
sends a 1 to the HOLD pin. Normally, after the current bus cycle is complete the 8086 will
respond by putting a 1 on the HLDA pin. When the requesting device receives this grant
signal it becomes the master. It will remain master until it drops the signal to the HOLD pin,
at which time the 8086 will drop the grant on the HLDA pin.

10. List the four possible modes of operation in 8237 DMA controller.
Rotating Priority Mode, Fixed Priority Mode, Extended Write Mode, TC Stop Mode and
Auto Load Mode.

11. What is the drawback of memory mapped I/O?(Nov 2016)


The big disadvantage of memory-mapped I/O devices is that they consume addresses in
the memory map. Generally, the minimum amount of space you can allocate to a peripheral
(or block of related peripherals) is a four kilobyte. Therefore, a few independent peripherals
can wind up consuming a fair amount of the physical address space.

12. What are the operating modes of 8255? (Nov 2013)


Mode-0, Mode-1 and Mode-2.

13. What is bus stealing? (Nov 2013)


During DMA data transfer, the I/O component connected to the system bus is given
control of the system bus for a bus cycle. This is called bus stealing or cycle stealing.

14. What are the advantages of Programmable Interval Timer/Counter IC? (May 2014)
 Interrupt a time sharing operating system at evenly spaced intervals.
 Output precisely timed signals with programmed period to an I/O device.
 Count the number of times an event occurs in an external experiment.
 Cause the processor to be interrupted after a programmable number of external events have
occurred.

15. List the features of Memory Mapped I/O. (May 2014)


The device registers can be accessed and manipulated with any instruction or addressing
mode. The maximum numbers of available memory locations are reduced.

16. List the operating modes of 8255 A and 8237 A. (Nov 2015)
Operating modes of 8255 A: BSR mode & I/O mode
BSR mode: In this mode, any of the 8 bits of port C can be set or reset.
I/O mode: Mode 0 (Basic I/O mode), Mode 1 (Strobed I/O mode) & Mode 2 (Strobed
bidirectional mode).
Operating modes of 8237 A: Rotating Priority Mode, Fixed Priority Mode, Extended Write
Mode, TC Stop Mode, Auto Load Mode

17. What frequency transmit clock (TXC) is required by an 8251 in order for it to
transmit data at 4800 baud with a baud rate factor of 16? (Nov 2015)
Baud rate factor = (TXC) / (Desired Baud Rate)
(TXC)= Baud rate factor X Desired Baud Rate = 16 X 4800= 76,800 Hz

22. Draw the format of read back command register of 8254. (May 2017)

9
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021
24. What are the handshake signals used in Mode – 2 configuration of 8255? (Nov 2017)
Only port A can be initialized in this mode. Port A can be used for bidirectional
handshake data transfer. This means that data can be input or output on the same eight lines
(PA0 - PA7). Pins PC3 - PC7 are used as handshake lines for port A. The remaining pins of
port C (PC0 - PC2) can be used as input/output lines if group B is initialized in mode 0 or as
handshaking for port B if group B is initialized in mode 1. In this mode, the 8255 may be
used to extend the system bus to a slave microprocessor or to transfer data bytes to and from
a floppy disk controller. Acknowledgement and handshaking signals are provided to maintain
proper data flow and synchronization between the data transmitter and receiver.

25. What are the operating modes of 8279? (May 2019)


Input Mode: Scanned Keyboard Mode, Scanned Sensor Matrix, Strobed Input
Output mode: Display Scan, Display entry

26. List the advantages and disadvantages of parallel communication over serial
communication. (May2016).
Parallel data transfer refers to the type of data transfer in which a group of bits are
transferred simultaneously while serial data transfer refers to the type of data transfer in
which a group of data bits are transferred one bit at a time. Therefore, the amount of data
transferred serially is less than the data transferred in parallel per second. Serial data
transfer requires fewer cables and therefore to transmit data over longer distances, serial
data transfer is preferred.

PART – B
1. Explain the procedure of Interfacing A/D and D/A converter with a microprocessor.(Nov
2016, May2014,Nov 2018)
(i) Explain the mode 0 operation of 8255 Programmable Peripheral interface. (ii) Explain the
different modes of operation of timer. (May 2014, 2017)
2. Explain the internal architecture of 8237 Direct Memory Access Controller. (Nov 2016,
May 2016, May 2017,May 2018,Nov 2018)
3. Draw the block diagram and explain the operations of 8251 serial communication
interface.
(Nov 2015, Nov 2017, May 2019)
4. Draw and explain the functional block diagram of parallel communication interfacing
chip.
(May 2017)
5. Draw the block diagram of traffic light control system using 8086.Write the algorithm and
ALP for traffic light control system?(May 2018)
6. Design a microcomputer based on 8086 with 16k EPROM and 16K RAM.
7. With a neat block diagram explain programmable interval timer IC 8253. (Dec 2014,
May2014)
8. Draw the block diagram of programmable interrupt controller and explain its operations.
(16) (Nov 2015,Nov 2018)
9. Draw and explain the block diagram of alarm controller.(May 2016,May 2018)
10. Develop a 8086 based system to display the word HELLO for every 2ms in the common
cathode seven segment LED display and check how many times the word is displayed for one
hour. (May 2017)
11. Draw and explain the functional block diagram of keyboard and display controller. (Nov
2017)
12. Draw the block diagram and explain the operation of USART?(May 2018)
13. Explain interrupt system based on multiple 8259 with block diagram.(May 2019)
14. Explain in detail about interfacing of four LCD digits to 8086.(May 2019)

10
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021

UNIT-IV MICROCONTROLLER
PART –A
1.Discuss the salient features of 8051 family of controllers?
 Eight-bit CPU with registers A (the accumulator) and B.
 Sixteen-bit program counter (PC) and data pointer (DPTR).
 Eight-bit program status word (PSW). Eight-bit stack pointer (SP).
 Internal ROM or EPROM (4 KB). Internal RAM (128 bytes)
 Four register banks (each 8 registers) 16 bytes, which may be addressed at bit
level
 Eighty bits of general purpose data memory Two 16-bit timer / counters: T0 &
T1
 Full duplex serial data receivers / transmitter (SBUF)
 Control registers: TCON, TMOD, SCON, PCON, IP and IE.
 Two external and three internal interrupt sources Oscillator and clock circuits

2.What are the addressing modes for a microcontroller?(Nov 2018)


Immediate, Direct, Register, Register indirect and Indexed addressing modes.

3.How many ports are available in 8051 micro controller? (May 2017)
There are mainly four ports available in this 8051 micro controller. They are
Port0: serve as inputs, outputs, or, when used together, as a bi-directional low
order address and as data bus for external memory.
Port1: has got no dual functions.
Port2: may be used as an input / output port similar in operation to port 1. The alternate use
of port2 is to supply a high-order address byte in conjunction with the Port0 low-order byte to
address external memory.
Port3: is an input / output pin similar to the Port 1. In this case each and every pin has an
additional function.

4.Which bits of the PSW are responsible for selection of the register banks?(May 2019)
RS0 and RS1 bits are used for selection of register banks
RS1 RS0 DESCRIPTION
0 0 BANK 0 is selected from Internal ROM
0 1 BANK 1 is selected from Internal ROM
1 0 BANK 2 is selected from Internal ROM
1 1 BANK 3 is selected from Internal ROM

5.What is meant by microcontroller?


A device which contains the microprocessor with integrated peripherals like memory,
serial ports, parallel ports, timer/counter, interrupt controller, data acquisition interfaces like
ADC, DAC on single chip is called microcontroller.

6.What is the significance of EA line of 8051 microcontroller? (May 2014, Nov 2016)
When there is no on-chip ROM in microcontroller and EA pin is connected to GND,
it indicates that the code is stored in external ROM.

11
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021

7.What is the difference between microprocessor and microcontroller? (May 2014,Nov


2018)
S.No Microprocessor Microcontroller
1. It has only CPU It has CPU, memory, timers, parallel and
serial I/O port on single chip
2. It has few bit manipulating It has large number of bit manipulating
instructions instructions
3. It has more number of It has only few instructions for transferring
instructions for transferring data data form external memory.
from external memory.
4. No special function registers are Special functions registers are available
available

8.List some of the applications of Microcontroller.


Building control (Fire detection), Industrial control (Process control), Motor speed
control (Stepper motor control), Standalone devices (Color Xerox machine), Automobile
applications (Power steering)

9.What is the difference between MOVX and MOV? (Nov 2013)


The MOV instruction is used to access code space of on-chip ROM and MOVX
instruction is used to access data space or external memory.

10.What are the different ways of operand addressing in 8051? (May 2016)
Immediate addressing mode, Direct addressing mode, Register addressing mode,
Register indirect addressing mode and Indexed addressing mode.

11.Mention some of the 8051 special function register.


ACC: Accumulator, B: B-Register, PSW: Program Status Word, SP: Stack Pointer,
DPTR: Data Pointer, IE: Interrupt Enable, SCON: Serial Control, PCON: Power Control.

12.Write an ALP to add the values ABH and 47H. Store the result in R1.
MOV A, #AB H
ADD A, #47 H
MOV R1, A
L1: SJMP L1

13.What are Bit manipulation instructions? Give two example.(May 2018)


8051 supports some operations on different bits of an 8-bit number. The operations are
like complementing, setting to 1, moving, AND’ing, OR’ing etc.

14.Draw the PIN diagram of 8051? (Nov 2016,May 2018)

12
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021

15.List the SFRs involved in interrupt programming of 8051 (Nov 2014)


Interrupt priority (IP), Control register, IE Register (Interrupt Enable)

16.Why it is necessary to have external pull-up for port 0 in 8051? (Nov 2014)
When port 0 is used as an output port, the pin latches that are programmed to a 0 will
turn on the lower FET, grounding the pin. All latches that are programmed to a 1 still float;
thus, external pullup resistors will be needed to supply a logic high when using port 0 as an
output port.

17.What is the difference between AJMP and LJMP instruction? (May 2014)
LJMP: LJMP (long jump) causes the program to branch to a destination address
defined by the 16-bit operand in the jump instruction. Because a 16-bit address is used the
instruction can cause a jump to any location within the 64KByte program space (216 = 64K).
Some example instructions are:
LJMP LABEL_X ; Jump to the specified label
LJMP 0F200h ; Jump to address 0F200h
LJMP @A+DPTR ; Jump to address which is the sum of DPTR and Reg. A
AJMP: This is a special 8051 jump instruction, which allows a jump with a 2KByte address
boundary (a 2K page)

18.How does the processor 8051 know whether on-chip ROM or external program
memory is used? (May 2014)
EA (External Access) pin is grounded for accessing external program memory &
PSEN (Program Store Enable) signal is activated to read a byte of instruction from External
program memory. EA & PSEN signals are not used for accessing internal program memory.
8051 differentiates the external and internal program memory by using EA and PSEN signals.

19.Mention the number of register banks and their addresses in 8051. (Nov 2015)
There are four register banks, in each register bank there are eight 8 bit register
available from R0 to R7. By default Bank 0 is selected. For Bank 0, R0 has address 00H and
R1 has 07H. For selecting banks we use RS0 and RS1 bit of PSW.
RS1 RS2 Space in RAM
0 0 Bank0 00h-07H
0 1 Bank1 08h-0FH
1 0 Bank2 10h-17H
1 1 Bank3 18h-1FH

20.What is the jump range? (Nov 2015)


Short jump range uses a single byte address. This address is a signed 8-bit number
and allows the program to branch to a distance –128 bytes back from the current PC address
or +127 bytes forward from the current PC address.
13
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021
Absolute jump range allows a jump with a 2KByte address boundary (a 2K page)
Long jump range causes the program to branch to a destination address defined by the 16-
bit operand in the jump instruction. Because a 16-bit address is used the instruction can cause
a jump to any location within the 64KByte program space (216 = 64K).

21.Illustrate the DJNZ instruction? (Nov 2017)


The DJNZ instruction decrements the byte indicated by the first operand and, if the resulting
value is not zero, branches to the address specified in the second operand. Eg: DJNZ Rn,
offset.

22.Illustrate the CJNE instruction. (May 2017)


CJNE stands for Compare and Jump of Not Equal. (CJNE operand 1, operand 2). The
operands are compared and if they are not equal the processor jumps to another.
23. Write an 8051 ALP to toggle P1 a total of 200 times. Use RAM location 32H to hold
your counter value instead of registers R0-R7. (May 2016)
MOV TMOD,#02
MOV 32H, #C8H
MOV TH0, 32H
SETB TR0
L1: CPL P1.0
JNB TF0, L1
CLR TR0
HERE: SJMP HERE

24.How to set 8051 in Idle mode? (Nov 2017)


In Idle Mode, only the clock provided to CPU gets deactivated, whereas peripherals
clock will remain active in this mode. Hence power saved in power down mode is more than
in idle mode. 8051 has power control register for power control.
PCON Register: Power control register
PCON (Power control) register is used to force the 8051 microcontroller into power saving
mode. Power control register of 8051 contains two power saving mode bits and one serial

baud rate bit.


Bit 0 – IDL: Idle
1 = Enable Idle mode. CPU clock turned off whereas internal peripheral module such as
timer, serial port, interrupts works normally. Interrupt and H/W reset can cancel this mode.
0 = Disable Idle mode.

25.Which port is used as multifunction port? List the signals. (May 2017)
Port 3.All port pins can be used as general I/O, but they also have an alternative
function. In order to use these alternative functions, a logic one (1) must be applied to
appropriate bit of the P3 register.
PIN Sym SFR Significance
bol
P3.0 RXD SBUF It is the received data pin for Port in UART Mode
serial
P3.1 TXD SBUF It is the transmit data pin for Serial port in UART mode
serial
P3.2 INT0 TCON.1 It is an external interrupt It is low level or falling edge
triggered
P3.3 INT1 TCON.3 It is an external interrupt It is low level or falling edge
triggered
P3.4 T 0 T<0 External timer / counter 0 Input pin gives pulse to T<0
register of the timer 0 to increase
14
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021
N by 1
P3.5 T 1 T<1 External timer / counter 1 Input pin gives pulse to T<1
register of the timer 0 to increase
by 1
P3.6 WR - It is an external memory writer Pulse it is an active low pulse
P3.7 RD - It is an external memory reader Pulse whenever data from
memory is read

PART-B
1. Discuss what happens if interrupt INTO, TFO and INT are activated at the same time.
Assume priority levels were set by the power-up reset and that the external interrupts are
edge triggered. (May 2019)
2. Draw the pin configuration of 8051 and explain the function of each pin in detail.(May
2014)
3. Write an assembly language program to multiply the given number 48H and 30H. (May
2017)
4. Draw the architecture of 8051 and explain? (Nov 2016, Nov 2017,May 2018)
5. (i)Explain in detail about the 8051 register banks and stack (ii)show the code to push r5,r6
and A onto the stack and then pop them back into r2,r3, and B where register B = register A,
r2=r6 and r3=r5.(May 2019)
6. Write an ALP using 8051 instruction to receive bytes of data serially and put them in P1.
Set the baud rate at 4800, 8-bit data and 1 stop bit? (Nov 2016)
7. Write an 8051ALP to create a square wave of 66 % duty cycle on bit 3 of port 1? (May
2016)
8. Explain in detail the memory organization of 8051 microcontroller. (Nov 2014)
9. Briefly explain the data transfer instructions available in 8051 microcontroller.
10. (i) Explain in detail about the Special Function Registers in 8051.Explain each register
with its format and functions. (May 2017,Nov 2018)
(ii) Briefly explain about addressing modes of 8051 with one example. (Nov 2015, May
2017,2018,2019)
11. (i) Give PSW of 8051 and describe the use of each bit in PSW.
(ii) Describe the functions of the following signals in 8051.RST, EA, PSEN and ALE (Nov
2015)
12. Discuss the ports and its circuits of 8051. How input/output ports and pins help in circuit
of microcontroller? (Nov 2017) (Nov 2018)

15
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021

UNIT-V INTERFACING MICROCONTROLLER


PART-A
1. Compare polling and interrupt? (May 2016)
When you do polling, it means you are regularly checking that a bit is set or not. This
takes time and you can do a lot of things before checking again and see that the bit actually
changed.
When working on interruption, the program continues running and do anything it wants and
when the event occurs, your software is stopped and executes the interrupt to deal with the
event. It means you react immediately to the event and that you don't need to check if the bit
is set or not.

2. Write short notes on interrupts in 8051? / List of 8051 interrupts with its priority.
(May 2017)
Interrupts may be generated by internal chip operations or provided by external
interrupts sources. Five interrupts are provided in 8051. Three of these interrupts are
generated automatically by internal operations: Timer flag 0, Timer flag 1, and the serial
port interrupts (RI or TI). Two interrupts are triggered by external signals provided by the
circuitry that is connected to the pins INT0 and INT1 (port pins P3.2 and P3.3).

3. What is the purpose of Interrupt priority (IP) Control register in 8051? (May 2017)
Register IP bits determine if any interrupt is to have a high or low priority. Bits set to
1 give the accompanying interrupt a high priority; a 0 assigns a low priority. If two interrupts
with the same priority occur at the same time, then they have the following ranking: IE0,
2.TF0, 3.IE1, 4.TF1, 5.Serial = RI or TI. For example, the serial interrupt could be given the
highest priority by setting the PS bit in the IP to 1, and all others to 0.

4. What is SBUF?
SBUF stands for SERIAL BUFFER. SBUF is physically two registers. One is write
only and is used to hold the data to be transmitted out of the 8051 via TXD. The other one is
read only and holds the received data from external sources via RXD. Both mutually
exclusive registers use address 99H.

5. What is the basic difference between a timer and a counter?


The only difference between a timer and a counter is the source of clock pulses to the
counters. When used as a timer, the clock pulses are sourced from the oscillator through the
divide-by-12d circuit. When used as a counter, pin T0 (P3.4) supplies pulses to counter 0, and
pin T1(P3.5) to counter 1.

6. For an 8051 system of 11.0592 Mhz, Find the time delay for the subroutine
Delay Mov r3,#250 1
16
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021
HereNop 1
Nop 1
Nop 1
Nop 1
DNJZ,R3, HERE 2
RET 2
The time delay inside the HERE loop is [250(1+1+1+1+2) +3 (outside loop)] x 1.085
µs = 1630.755 µs.

7. What are the types of ADC? (Nov 2018)


The common types of ADCs are flash, successive approximation, and sigma-delta.

8. What is the function of the TMOD register?


(Timer mode) register is used to set the various timer operation modes. TMOD is
dedicated solely to the two timers (T0 & T1) and can be considered to be two duplicate 4-bit
registers, each of which controls the action of the timers.

9. What is the difference between watch dog timer and ordinary timer? (Nov 2013)
The watch dog timer is provided for the system to check itself and reset if it is not
functioning properly. The watch dog register is a 16 bit-counter which is incremented every
state time.

10. Define baud rate of 8051? (May 2016)


The 8051 includes an on-chip serial port that can be programmed to operate in one of
four different modes and at a range of frequencies. In serial communication the data rate is
known as the baud rate, which simply means the number of bits transmitted per second.

11. How to program 8051 timer? (Nov 2018)


The 8051 has two timers: Timer 0 and Timer 1. They can be used either as timers or
as event counters. It can be programmed using TCON and TMOD registers.

12. What are the types of sensors used for interfacing? / Give two examples of sensors
and its uses. (May 2017, Nov 2017, May 2018)
The different types of sensors that can be interfaced with microprocessors are
Temperature Sensors, IR Sensors, Ultrasonic Sensors, Touch Sensors, Proximity Sensors,
Pressure Sensors, Level Sensors, Smoke and Gas Sensors etc.

13. What is the significance of WR and INTR pin in ADC chip?


WR is an active low input and when it undergoes low to high transition the Start of
conversion signal is given. INTR is an active low output pin. It is normally high when the A
to D conversion is finished. It goes low to signal EOC.

14. Write an ALP to generate a saw tooth waveform.


MOV A.#00H
MOV P1,A
BACK: INC A
SJMP BACK

15. When is external memory access generated in 8051?(May 2019).


PSEN (Program Store Enable) is an output signal for the 8051 microcontroller, which
is connected to the OE pin of external ROM containing the program code. This is used when
external ROM has to be accessed.
17
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021

16. What is the relation between RPM and steps per second in stepper motor
interfacing?
Steps per second= (rpm × steps per revolution)/60

17. What are the different modes timer 2 can operate?(may 2019)
Details 00 01 10 11
M1 This is for Mode 0. This is Mode 1. This is Mode 2 This is Mode 3
M0 (8-bit timer/counter, (16-bit (8-bit auto (The function
with 5-bit pre- timer/counter) reload-timer/cou depends on Timer0
scaler) nter) or T

18. What are the contents of SCON register?


7 6 5 4 3 2 1 0
SMO SM1 SM2 REN TB8 RB8 TI RI
SM0-Serial port mode bit 0, SM1-Serial port mode bit 1, SM2-Serial port mode 2 bit (or)
multiprocessor communication enable bit, REN-Reception Enable bit, TB8-Transmitter bit 8.
RB8 - Receiver bit 8 or the 9th bit received in modes 2 and 3, TI - Transmit Interrupt flag, RI
- Receive Interrupt flag.

19. What are the various baud rates possible in 8051?


Baud rate TH1(decimal) TH1(hex)
9600 -3 FD
4800 -6 FA
2400 -12 F4

20. Give the priority level in 8051?(May 2018)


Interrupt priority
Ex0 1(highest)
Timer 0 2
Ex1 3
Timer 1 4
Serial port 5(lowest)

21. Write about the design steps involved in using microcontroller for stepper motor.
(May 2014)
The four leads of the stator winding are controlled by four bits of the 8051 port (P1.0-
P1.3). Since the 8051 lacks sufficient current to drive the stepper motor windings, a driver
such as ULN2003 is used to energize the stator. The ULN2003 has an internal diode to take
care of back EMF.

22. Mention the features of serial port in mode 0. (Nov 2015)


 Mode 0 of 8051 serial port is shift register mode.
 Serial data enters and exits through RXD pin.
 Pin TXD is connected to the internal shift frequency pulse source to supply
shift pulses to circuits.
 8-bits are transmitted and received; the baud rate is fixed at 1/12 of the crystal
frequency.

23. How is A/D converter interfaced with 8051? (Nov 2015)

18
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021

One of the most commonly used ADC is ADC0808. ADC 0808 is a Successive
approximation type with 8 channels i.e. it can directly access 8 single ended analog signals.
ADC0808 has an 8-bit data output. The Microcontroller 8051 is used to provide the control
signals to the ADC. The pin P2.0, P2.1 and P2.2 are connected to address pins A, B, and C to
select IN0 – IN7, and activate ALE using pin P2.4 to latch in the address. START is for the
start of conversion connected pin P2.3. EOC is for end-of-conversion connected to pin P2.6,
and OE is for output enable connected to pin P2.5. The port P1 is used as an input port which
receives the digital data from the ADC.

24. Define baud rate of 8051 using timer 1. (May 2016, Nov 2016)
8051 divides the crystal frequency by 12 to get machine cycle frequency. In case of
XTAL = 11.0592 MHz. so machine cycle here becomes 921.6 KHz. Now the 8051 UART
circuitry divides the machine cycle frequency of 921.6 KHz by 32 once more before it is used
by timer 1 to set the baud rate. So 921.6 KHz divided by 32 gives 28,800 Hz. This is the
value of frequency upon which we will perform operation to get variable baud rate. When
timer 1 is used to set baud rate it must be programmed in mode 2 8 bit auto reload. Timer 1
TH1 register values for various baud rates.

25. List of timer modes in 8051.(Nov 2016)


Mode 0: 13-bit timer mode, 8-bit timer/counter THx and TLx as 5-bit prescalar.
Mode 1: 16-bit timer mode, 16-bit timer/counters THx and TLx are cascaded; There are no
prescalar.
Mode 2: -bit auto reload mode, 8-bit auto reload timer/counter; THx holds a value which is to
be reloaded into TLx each time it overflows.
Mode 3: Spilt timer mode.

PART-B
1. Describe the different modes of operations of timer/counter in 8051 microcontroller?(Nov
2016)
2. (i)Interface the ADC converter with 8051 and explain with neat diagram. (ii) Write the
assembly language program to execute the ADC conversion. (Nov 2017)
3. Illustrate the serial communication in 8051, with its special function register.(May 2016,
Nov 2017)
4. With a neat circuit diagram explain how a 4x4 keypad is interfaced with 8051
microcontroller and write 8051 ALP for keypad scanning. (Nov 2015)
5. Draw the schematic for interfacing a stepper motor with 8051 microcontroller and write
8051 ALP for changing speed and direction of motor and also and develop program to rotate
the motor in clockwise direction. (Nov 2015, May 2014, Nov 2016, 2017)
6. Write a program for generation of unipolar square waveform 1 KHz frequency using
Timer 0 of 8051 in mode 0. Consider the system frequency as 12MHz. (May 2017, Nov
2017)
7. Develop 8051 based system design having 8Kbyte RAM to generate the triangular wave
using DAC. (May 2017)
8. Describe the different modes of timer / counter functions in 8051 Micro Controller with
its associate register.(May 2018)
9. Write and explain, what is serial port programming?(Nov 2018)
10. What are sensor interfacing and external memory interfacing? Explain.(Nov 2018)
19
EC8691-Microprocessor and Microcontroller Department of CSE & IT 2020-2021
11. How microprocessor and microcontroller are different from computer based controller?
(Nov 2018)
12. How microprocessor and microcontroller can help to control a process or machine tool?
(Nov 2018)
13. Describe how to program and interface an LCD to an 8051 using assembly language
programming.(May 2019)
14. Draw and explain the DAC interfacing using 8051?(May 2019)
15. i)Discuss the number of pin sets aside for addresses in each of the following memory
chips1)16k*4 DRAM2)16k*4SRAM
ii)Briefly explain about interfacing of 8051 with external data ROM.(May 2019)
16. With necessary diagrams explain how to interface LM35 temperature sensor and then
discuss the issues of signal conditioning .(May 2019)

20

You might also like