Ec8691 MP MC Question Bank
Ec8691 MP MC Question Bank
Ec8691 MP MC Question Bank
Page 1
PART-A
1. What is microprocessor?
2. What is Accumulator?
The Accumulator is an 8-bit register that is part of the arithmetic/logic unit (ALU). This
register is used to store 8-bit data and to perform arithmetic and logical operations. The result of an
operation is stored in the accumulator. The accumulator is also identified as register A.
3. What is stack?
The stack is a group of memory locations in the R/W memory that is used for temporary
storage of binary information during the execution of a program
A subroutine is a group of instructions written separately from the main program to perform a
function that occurs repeatedly in the main program. Thus subroutines avoid the repetition of same
set of instructions in the main program.
Addressing mode is used to specify the way in which the address of the operand is specified
within the instruction.
7. Write a program to add a data byte located at offset 0500H in 2000H segment to another
data byte available at 0600H in the same segment and store the result at 0700H in the same
segment.
MOV AX, [500H]; Get first data byte from 0500H offset
ADD AX, [600H]; Add this to the second byte from 0600H
Page 2
MOV [700H], AX; store AX in 0700H
HLT; Stop.
8. What are the different types of addressing modes of 8085 instruction set? (Nov/Dec2013)
(Apr/May 2015)
i. Immediate
ii. Direct
iii. Register
v. Indexed
A program called assembler is used to convert the mnemonics of instruction and data into
their equivalent object code modules. The object code modules are further converted into executable
code using linker and loader programs. This type of programming is calledassembly level
Page 3
programming.
Stack is a top-down data structure, whose elements are accessed using a pointer that is
implemented using the SS and SP registers. It is a LIFO data segment.
The stack top address is calculated using the contents of the SS and SP register. The contents
of stack segment (SS) register is shifted left by four bit positions (multiplied by(0h)) and the resulted
20-bit content is added with the 16-bit offset value of the stack pointer(SP) register.
Macros are small routines that are used to replace strings in the program. They can have
parameters passed to them, which enhances the functionality of the micro itself.
Constants are declared in the same way as variables, using the format:
When the constants label is encountered, the constant numeric value is exchanged for the string.
15. Write an assembly language program for a 16-bit increment and will not affect the
contents of the accumulator.
INC variable + 1
Page 4
Inc16 End;Yes–increment the upper 8 bits
POP ACC
END MAC
16. What will happen if a label within a macro is not declared local?
If a label within a macro is not declared local, then at assembly time, there will be two types
of errors:
I. The first will state that there are multiple labels in the source.
II. The second will indicate that jump instructions don’t know which one to use.
17. Write an assembly language program to load the accumulator with a constant value.
if (value==0)
MOV A, #1
else
clr A
end if
END MAC.
Microprocessor does not contain RAM, ROM and I/O ports on the chip. But a
microcontroller contains RAM, ROM and I/O ports and a timer all on a single chip.
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.
The loader copies the program into the computer’s main memory at load time and begins the
program execution at execution time.
Page 5
21. What is linker?
A linker is a program used to join together several object files into one large object file. For
large programs it is more efficient to divide the large program modules into smaller modules. Each
module is individually written, tested & debugged. When all the modules work they are linked
together to form a large functioning program.
The ALIGN directive forces the assembler to align the next segment at an address divisible
by specified divisor. The format is ALIGN number where number can be 2,4, 8 or 16. Example
ALIGN 8. The ASSUME directive assigns a logical segment to a physical segment at any given
time. It tells the assembler what address will be in the segment registers at execution time. Example
ASSUME CS: code, DS: data, SS: stack
A program may contain several segments of the same type. The GROUP directive collects
them under a single name so they can reside in a single segment, usually a data segment. The format
is Name GROUP Seg-name,…..Seg-name PTR is used to assign a specific type to a variable or a
label. It is also used to override the declared type of a variable.
PROC directive defines the procedures in the program. The procedure name must be unique.
After PROC the term NEAR or FAR are used to specify the type of procedure. Example FACT
PROC FAR.ENDP is used along with PROC and defines the end of the procedure.
An assembly program in .EXE format consists of one or more segments. The starts of these
segments are defined by SEGMENT and the end of the segment is indicated by ENDS directive.
Format Name SEGMENT.
The segment override prefix allows the programmer to deviate from the default
A variable is an identifier that is associated with the first byte of data item. In assembly
language statement: COUNT DB 20H, COUNT is the variable.
Page 6
28. What are procedures?
Procedures are a group of instructions stored as a separate program in memory and it is called
from the main program whenever required. The type of procedure depends on where the procedures
are stored in memory. If it is in the same code segment as that of the main program then it is a near
procedure otherwise it is a far procedure.
A linker is a program used to join together several object files into one large object file. The
linker produces a link file which contains the binary codes for all the combined modules. It also
produces a link map which contains the address information about the link files. The linker does not
assign Absolute addresses but only relative address starting from zero, so the programs are
relocatable& can be put anywhere in memory to be run.
Procedure Macro
Accessed by CALL & RET instruction Accessed during assembly with name to
during program execution macro when defined
Machine code for instruction is put only Machine code is generated for instruction
With procedures less memory is required With macro more memory is required
Page 7
31. What is the maximum memory size that can be addressed by 8085? (April/May 2014)
(Nov/Dec 2014)
In 8085, a memory location is addressed by 20 bit address and the address bus is 20 bit
address and the address bus is 20 bits. So it can address up to one megabyte (220) of memory space.
32. How many data lines and address lines are available in 8085?
33. What information is conveyed when Qs1 and Qs0 are 01?
Qs1 and Qs0 are output signals that reflect the status of the instruction queue. When Qs1 and
Qs0 are 01 , then queue has first byte of an opcode.
34. What is the addressing mode of MOV AX, 55H (BX) (SI) ?
MOV AX, 55H (BX) (SI) – Base Indexed memory addressing mode.
Dedicated interrupts
• Type 3: Breakpoint
Interrupt means to break the sequence of operation. While the CPU is executing a program an
interrupt breaks the normal sequence of execution of instructions & diverts its execution to some
other program. This program to which the control is transferred is called the interrupt service routine.
37. Calculate the physical address for fetching the next instruction to be executed, in 8085?
The physical address is obtained by appending four zeros to the content present in CS register
and then adding the content of IP register with the above value .
Page 8
CS = 1200 H
IP = 0345 H
38. If the execution unit generates effective address of 43A2 H and the DS register contains
4000 H. What will be the physical address generated by the BIU? What is the Maximum Size of
the data segment?
39. Calculate the physical address, when segment address is 1085H and effective address is
4537H. [Nov/Dec 2015]
40. Show how the 2 byte INT instruction can be applied for debugging. [Nov/Dec2015]
INT type
The INT instruction is used as a debugging and in case where single stepping provides more detail
then is wanted, by inserting INT instructions at key points called break points.
Page 9
41. List the flags of 8085. [May/June 2016]
AF - Aux. ...
PF - Parity Flag.
PART-B
Page 10
1. (a) Explain the register organization of 8085.U(10)(April/May2013)
(b) Explain the pin diagram of 8085 (6) U
4. Explain briefly about the internal hardware architecture of 8085 microprocessor with a neat
diagram (Apr/May 2015) (10) U
5. Write an assembly language program in 8085 to convert BCD data – binarydata. C (Apr/May
2015) (6)
6. Explain briefly about Interrupt handling process in 8085. (Apr/May 2015) (8) U
7. Explain in detail about the interrupts and interrupt service routines of 8085.
[Apr/May 2015] [Nov/Dec 2015] U
8. (I) Explain the Data transfer, arithmetic and branch instructions with examples.(9) U
(II) Write an 8085 ALP to find the sum of numbers in an arry of 10 element. (7) [May/June
2016]
9. Define interrupts and their types. Write in detail about interrupt service routine. (16) C
[May/June 2016]
COURSE OUTCOME: Learnt the architecture, Instruction set and Programming of 8085
Microprocessor.
Page 11
UNIT II
SYLLABUS: 8085 signals – Basic configurations – System bus timing –System design using 8085 –
IO programming – Introduction to Multiprogramming – System Bus Structure - Multiprocessor
configurations – Coprocessor, Closely coupled and loosely Coupled configurations – Introduction to
advanced processors.
COURSE OBJECTIVE: Study about the system bus structure and Multiprocessor Configurations.
PART A
i. Bus Interface Unit (BIU): BIU sends out addresses, fetches instruction from memory, reads data
from ports and memory and writes data to ports and memory.
ii. Execution Unit (EU):EU tells the BIU where to fetch instructions or data, decodes instructions and
executes instructions.
10
3. Give any four pin definitions for the minimum mode. (Nov/Dec2008)
4. What are the pins that are used to indicate the type of transfer in minimum mode?
The M/IO, RD, WR lines specify the type of transfer. It is indicated in the following table:
S2, S1, S0 indicates the type of transfer to take place during the current bus cycle.
11
6. Give any four pin definitions for maximum mode.
7. Draw the bus request and bus grant timings in minimum mode system.
The decoder in EU translates instructions fetched from memory into a series of actions, which
the EU carries out.
i. General purpose registers: They are used for holding data, variables and
intermediate results temporarily.
ii. Special purpose registers: They are used as segment registers, pointers, index
register or asoffset storage registers for particular addressing modes.
12
10. What are general data registers?
The registers AX, BX, CX and DX are the general data registers.
iii. BX register is used as offset storage for forming physical addresses in case of certain
addressing modes.
iv. CX register is used as a default counter in case of string and loop instructions.
i. Code segment register: It is used for addressing a memory location in the code segment of the
memory, where the executable program is stored.
ii. Data segment register: It points to the data segment of the memory, where data is resided.
iv. Stack segment register: It is used for addressing stock segment of memory. It is used to store stack
data.
IP, BP and SP are the pointers and contain offsets within the code, data and stack segments
respectively. SI and DI are the index registers, which are used as general purpose registers and also
for offset storage in case of indexed, based indexed and relative based indexed addressing modes.
13
13. How is the physical address calculated? Give an example.
The physical address, which is 20-bits long is calculated using the segment and
offsetregisters, each 16-bits long. The segment address is shifted left bit-wise four times and offset
address is added to this to produce a 20 bit physical address.
Memory segmentation is the process of completely dividing the physically available memory
into a number of logical segments. Each segment is 64K byte in size and is addressed by one of the
segment register.
i. Allows the memory capacity to be 1Mbyte, although the actual addresses to be handled are of 16-
bit size.
ii. Allows the placing of code, data and stack portions of the same program in different parts of
memory for data and code protection.
iii. Permits a program and/or its data to be put into different areas of memory, each times program is
executed i.e., provision for relocation may be done.
Fetching the next instruction while the current instruction executes is called pipelining.
i. Condition code or status flag register: It consists of six flags to indicate some condition produced
by an instruction.
ii. Machine control flag register: It consists of three flags and are used to control certain operations of
the processor.
14
18. Draw the format of 8085 flag register. (April/May2011)
i. Trap flag: If this flag is set, the processor enters the single step execution.
ii. Interrupt flag: If this flag is set, the maskable interrupts are recognized by the
CPU, otherwise they are ignored.
iii. Direction flag: This is used by string manipulation instructions. If this flag bit is„0‟, the string is
processed from the lowest to the highest address i.e., auto incrementing mode. Otherwise, the string
is processed from highest address to lowest address, i.e., auto decrementing mode.
AD15 – AD0 are time multiplexed memory I/O address and data lines. Address remains on
the lines during T1 state, while data is available on data bus during T2, T3, Tw and T4 states. These
lines are active high and float to a tristate during interrupt acknowledge and local bus hold
acknowledge cycles.
RD is an active low signal. When it is low, it indicates the peripherals that the processor is
performing a memory or I/O read operation.
15
23. Give the function of i. Ready and ii. INTR signal. (May/Jun 2013)
i. Ready signal: It is an acknowledgement from slow devices of memory that they have completed
data transfer. The signal is synchronized by 8284 A clock generator to give ready input to 8085. The
signal is active high.
ii. INTR signal: It is a level triggered input. This is sampled during the last cycle of each instruction
to determine the availability of the request. If any interrupt request is pending, the processor enters
the interrupt acknowledge cycle. This can be internally masked by resetting the interrupt enable flag.
The signal is active high and internally synchronized.
When the TEST input is low, execution will continue, else, the processor remains in an idle state.
NMI is an edge-triggered input, which causes a type 2 interrupt. It is not maskable internally by
software and transition from low to high initiate the interrupt response at the end of the current
instruction. This input is internally synchronized.
The clock input provides the basic timing for processor operation and bus control activity. It is an
asymmetric square wave with 33% duty cycle. The range of frequency varies from5MHz to 10MHz.
27. What is the function of pin? (April/May2011)
The logic level at pin decides whether processor operates in minimum or maximum
mode.
=0 Maximum Mode
=1 Minimum Mode
When a high is given to RESET pin, the processor terminates the current activity and starts executing
from FFFF0H. It must be active for at least four clock cycles. It is internally synchronized.
29. What will happen when a DMA request is made, while the CPU is performing a memory or
I/O cycles? Nov/dec2011
When a DMA request is made, while the CPU is performing a memory or I/O cycles, it will
request the local bus during T4 provided:
16
ii. The current cycle is not operating over the lower byte of a word.
iii. The current cycle is not the first acknowledge of an interrupt acknowledge sequence.
iv. A lock instruction is not being executed.
30. What is multiprogramming? [Nov/Dec 2015]
If more than one process is carried out at the same time, then it is known as
multiprogramming. Another definition is the interleaving of CPU and I/O operations among several
programs is called multiprogramming. To improve the utilization of CPU and I/O devices, we are
designing to process a set of independent programs concurrently by a single CPU. This technique is
known as multiprogramming.
31. Write the advantages of loosely coupled system over tightly coupled systems?
1. More number of CPUs can be added in a loosely coupled system to improve the system
performance
2. The system structure is modular and hence easy to maintain and troubleshoot.
3. A fault in a single module does not lead to a complete system breakdown.
32. What is the different clock frequencies used in 80286?
Various versions of 80286 are available that run on 12.5MHz, 10MHz and 8MHz clock frequencies.
The portion of a program is required for execution by the CPU, it is fetched from the secondary
memory and placed in the physical memory. This is called ‘swapping in’ of the program.
The 80286 CPU contains almost the same set of registers, as in 8085
Qs1, Qs0, s0, s1, s2, LOCK, RQ/GT1, RQ/GT0 are the signals used in 8085 maximum mode
operation.
37. Write the size of physical memory and virtual memory of 8085 microprocessor.
17
Physical addresses are formed when the left shifted segment base address is added to the
offset address. The combination of segment register base addresses and offset address is the logical
address in memory. Size of physical memory=220=1MB Size of virtual memory=216=64 KB
It allows the memory addressing capacity to be 1MB even though the address associated with
individual instruction is only 16-bit.
It facilitates use of separate memory areas for program , data and stack.
BHE (Bus High Enable): Low on this pin during first part of the machine cycle indicates that
at least one byte of the current transfer is to be made on higher byte AD15-AD8.
LOCK: This signal indicates that an instruction with a LOCK prefix is being executed and the
bus is not to be used by another processor.
S2 S1 S0
0 1 1 ---- Halt
1 1 1 ---- inactive
S4 S3
S7 --Address transfer.
43. What are the differences between maximum mode and minimum mode [NOV/DEC 2003]
Minimum mode
Maximum mode
2. The processor derive the status signals S2, Sl and So. Another chip called bus
controller derives control signals using this status information.
The coprocessor is a processor which specially designed for processor to work under the
control of the processor and support special processing capabilities. Example : 8087 which has
numeric processing capability and works under 8085.
19
46. Differentiate External verses Internal Bus. [MAY/JUNE 2016]
Internal Data Bus: The internal data bus only works inside a CPU that is internally. It is able to
communicate with the internal cache memories of the CPU. Since they are internally placed they are
relatively quick and are now affected by the rest of the computer.
External Data bus: This type of bus is used to connect and interface the computer to its connected
peripheral devices. Since they are external and do not lie within the circuitry of the cpu they are
relatively slower. The 8088 processor in itself contains a 16-bit internal data bus coupled with a 20-
bit address register. This allows the processor to address to a maximum of 1 MB memory.
PART-B
1. (a) Draw and explain the maximum mode of 8085 (12)(April/May 2012) U
(b) List the advantages of multiprocessor system (4) C
2. (i) Show the pin configuration and function of signals of 8085 microprocessor. (8)
A/E (april/May2011)
(ii) Show the memory organization and interfacing with 8085 microprocessor. Explain how the
memory is accessed. (8) (April/May 2011) A/E
4. (a) Draw and explain the block diagram of minimum mode of operation
(12)(NOV/Dec2011) U
(b)Write notes on addressing memory (4) (May/June2014) C
20
5. Define the bus cycle and minimum mode read and write bus cycles with proper timing diagram
(16) (April/May2013) R
6. (a) Draw the input and output timing diagram of maximum mode of operation in8085 (10) A/E
(b) Explain the addressing capabilities of 8085 (6) (Nov/Dec2013) U
7. Discuss the maximum mode configuration of 8085 with a neat diagram. Mention the functions
of the various signals. (16) (Apr/May 2015) U
10. Explain the bus interface unit and execution unit of 8085 microprocessor. (8) (Nov/Dec 2014) U
11. Describe the sequence of signals that occurs on the address bus, the control bus and the data bus
when a simple microcomputer fetches an instruction. (8) (Nov/Dec 2014) R
12. Write an assembly language program to multiply two 16 bit numbers to give 32 bit result. (8)
(Nov/Dec 2014) C
13. Describe the conditions which cause the 8085 to perform type 0 and type 1 interrupt. (8)
(Nov/Dec 2014) R
14. Define loosely coupled system. Explain the schemes used for establishing priority.
[NOV/DEC'15] U
15. Explain in detail about the system bus timing of 8085.(16)[May/June 2016] U
21
UNIT III
I/O INTERFACING
SYLLABUS: Memory Interfacing and I/O interfacing - Parallel communication interface – Serial
communication interface – D/A and A/D Interface - Timer – Keyboard /display controller – Interrupt
controller – DMA controller – Programming and applications Case studies: Traffic Light control,
LED display , LCD display, Keyboard display interface and Alarm Controller.
COURSE OBJECTIVE: To learn the design aspects of I/O and memory interfacing circuits.
PART-A
This is one of the techniques for interfacing I/O devices with μp. In memory mapped I/O, the
I/O devices assigned and identified by 16-bit addresses. To transfer the data between MPU and I/O
devices memory related instructions (such as LDA, STA etc.) and memory control signals (MEMR,
MEMW) are used.
This is one of the techniques for interfacing I/O devices with μp. In I/O mapped I/O, the I/O
devices assigned and identified by 8-bit addresses. To transfer the data between MPU and I/O
devices I/O related instructions (IN and OUT ) and I/O control signals (IOR, IOW) are used.
Simplex transmission: data are transmitted in only one direction. Duplex transmission: data
flow in both directions. If the transmission goes one way at a time, it is called half duplex; if it goes
both way simultaneously, then it is called full duplex.
The rate at which the bits are transmitted, bits per second is called Baud.
22
6. What is USART?
It is a programmable device. Its function and specification for serial I/O can be determined by
writing instructions in its internal registers. The Intel 8251A USART is a device widely used in serial
I/O.
The 8255A has 24 I/O pins that can be primarily grouped primarily in two 8-bit Parallel ports:
A and B, with eight bits as port C. The 8-bits of port C can be used as two 4-bit ports: C UPPER CU
and CLOWER CL.
All functions of 8255 are classified according to 2 modes. In the control word, if D7 = 0, then
it represents bit set reset mode operation. The BSR mode is used to set or reset the bits in port C.
In this mode, ports A and B are used as two simple 8-bit I/O ports and port C as two 4-bit
ports. Each port can be programmed to function as an input port or an output port. The input/ output
features in mode 0 as follows:
The electronic circuit that translates an analog signal into a digital signal is called analog-to-
digital converter(ADC).The electronic circuit translates a digital signal into an analog signal is called
Digital-to-analog Converter(DAC).
It is defined as the total time required to convert an analog signal into a digital output. It is
determined the conversion technique used and by the propagation delay in various circuits.
23
13. Write the control word format for BSR mode.
It is defined as a ratio of change in value of input voltage Vi, needed to change the digital
output by 1 LSB. If the full scale input voltage required to cause a digital output of all 1‟s is ViFS.
Then the resolution can be given as
24
17. List the functions performed by 8279. (April/May2009)
iii. It provides multiplexed display interface with blanking and inhibit options.
The push button keys when pressed, bounces a few times, closing and opening the contacts
before providing a steady reading. So reading taken during bouncing may be faulty. Therefore the
microprocessor must wait until the key reach to steady state. This is known as key debounce.
In N-key rollover each key depression is treated independently from all others. When a key is
depressed, the denounce logic is set and 8279 checks for key depress during next two scans.
21. Find the program clock command word if external clock frequency is 2 MHz.
Whenever a number of devices interrupt a CPU at a time, and id the processor is able to
handle them properly, it is said to have multiple interrupt processing capability.
An 8085 interrupt can come from any one of three sources. One source is an external signal
applied to the nonmaskable interrupt (NMI) input in or to the interrupt (INTR) input pin. An interrupt
caused by the signal applied to one of these input is referred to as a hardware interrupt
25
24. What is software interrupt?
The interrupt caused due to execution of interrupt instruction is called software interrupt.
ii. Internal interrupts: It is generated internally by the processor circuit or by the execution
of an interrupt instruction. Example: Zero interrupt, overflow interrupt.
26. What is the purpose of control word written to control register in8255? (April/May2011)
The control words written to control register specify an I/O function for each I.O port. The bit
D7 of the control word determines either the I/O function of the BSR function.
When the key is depressed and released, the contact is not broken permanently. In fact, the key
makes and breaks the contacts several times for a few milliseconds before the contact is broken
permanently.
26
PART-B
1. With the help of neat diagram explain how 8251 is interfaced with 8085 and used for serial
Communication (16) ( May/June2013) U
2. (i) Explain the operation of 8255 PPI Port A programmed as input and output in Mode 1
with necessary handshaking signals. (8) (April/May2011) U
(ii) Show and explain the ADC interfacing with 8085 microprocessor. (8) (April/May2011) U
3. With functional block diagram, explain the operation and programming of 8251 USART
(Serial communication Interface) in detail (April/May2011)[NOV/DEC 2015] U
4. Explain how D/A and D/A interfacing is done with 8085 with an application.
(Apr/May2015) (10) U
5. What is DMA? Explain the DMA based data transfer using DMA controller. (Apr/May 2015)
(6)
6. Draw the block diagram of traffic light control system using 8085. (Apr/May 2015) (8) A/E
13.Write the algorithm and assembly language program for traffic light control system.(Apr/May
2015) (8) C
14. Draw the block diagram of programmable Interrupt controller (8259) and explain its operations. U
[NOV/DEC 2015]
15. Explain in detail about DMA controller with its diagram. (16) U [May/June 2016]
16.Draw and Explain the block diagram of alarm controller. (16)U [May/June 2016]
COURSE OUTCOMES: Get exposed to all peripheral devices and its interfacing
27
UNIT-IV
MICROCONTROLLER
SYLLABUS: Architecture of 8051 – Special Function Registers(SFRs) - I/O Pins Ports and Circuits
- Instruction set - Addressing modes - Assembly language programming.
PART-A
The special function register are stack pointer, index pointer (DPL and DPH), I/O port
addresses, status (PSW) and accumulator.
The accumulator registers (A and B at addresses OEOh and OFOh, respectively) are used to
store temporary values and the results of arithmetic operations.
Program status word (PSW) is the set of flags that contains the status information and is
considered as one of the special function register.
Stack pointer (SP) is a 8 bit wide register and is incremented before the data is stored into the
stack using PUSH or CALL instructions. It contains 8-bit stack top address. It is defined anywhere in
the on-chip 128-byte RAM. After reset, the SP register is initialized to 07. After each write to stack
operation, the 8-bit contents of the operand are stored onto the stack, after incrementing the SP
register by one. It is not a top-down data structure. It is allotted an address in the special function
register bank.
It is a 16-bit register that contains a higher byte (DPH) and lower byte (DPL) of a 16-bit
external data RAM address. It is accessed as a 16-bit register or two 8-bit registers. It has been
allotted two addresses in the special function register bank, for its two bytes DPH and DPL.
Oscillator circuit is used to generate the basic timing clock signal for the operation of the
circuit using crystal oscillator.
28
7. What is the purpose of using instruction register?
Instruction register is used for the purpose of decoding the opcode of an instruction to be
executed and gives information to the timing and control unit generating necessary signals for the
execution of the instruction.
ALE/PROG is an address latch enable output pulse and indicates that valid address bits
available on the respective pins. The ALE pulses are emitted at a rate of one-sixth of the oscillator
frequency. The signal is valid only for external memory accesses.
The operands are specified using the 8-bit address field, in the instruction format. Only
internal data Ram and SFRS can be directly addressed. This is known as direct addressing mode.
It may be used for external timing or clockwise purpose. One ALE pulse is skipped during
each access to external data memory.
Idle mode: In this mode, the oscillator continues to run and the interrupt, serial port and timer
blocks are active, but the clock to the CPU is disabled. The CPU status is preserved. This
mode can be terminated with a hardware interrupt or hardware reset signal. After this, the
CPU resumes program execution from where it left off.
Power down mode: In this mode, the on-chip oscillator is stopped. All the functions of the
controller are held maintaining the contents of RAM. The only way to terminate this mode is
hardware reset. The reset redefines all the SFRs but the RAM contents are left unchanged.
29
12. Differentiate between program memory and data memory.
Program Memory
i. It stores the programs to be executed.
ii. It stores only program code which is to be executed and thus it need not be written, so it is
implemented using EPROM It stores the data, line intermediate results, variables and constants
required for the execution of the program.
Data Memory:The data memory may be read from or written to and thus it is implemented
using RAM.
Eg: Mov R0, 89H
In this mode, the 8-bit address of an operand is stored in a register and the register, instead of
the 8-bitaddress, is specified in the instruction. The registers R0 and R1 of the selected bank of
registers or stack pointer can be used as address registers for storing the 8-bit addresses. The address
register for 16-bit addresses can only be „data pointer‟ (DPTR).
The operations are stored in the registers R0 – R7 of the selected register bank. One of these
eight registers(R0 – R7) is specified in the instruction using the 3-bit register specification field of
the opcode format. A register bank can be selected using the two bank select bits of the PSN. This is
called as register instruction addressing mode
An immediate data ie., a constant is specified in the instruction, after the opcode byte.
Eg: MOV A, #100 The immediate data 100 (decimal) is added to the contents of the accumulator.
For specifying a hex number,it should be followed by H. These are known as immediate addressing
mode.
The movement of data between the accumulator and Rn (for n = 0 to 7) is valid. But
movement of data between Rn register is not allowed. That is why MOV R4, R7 is invalid.
In the 8051 microcontroller registers A, B, PSW and DPTR are part of the group of registers
commonly referred to as special function registers (SFR).
30
18. What is indexed addressing? (May/June2014)
This addressing mode is used only to access the program memory. It is accomplished in 8051
for look-up table manipulations. Program counter or data pointer are the allowed 16-bit address
storage registers, in this mode of addressing. These 16-bit registers point to the base of the look-up
table and the ACC register contains a code to be converted using the look-up table. The look-up table
data address is found out by adding the contents of register ACC with that of the program counter or
data pointer. In case of jump instruction, the contents of accumulator are added with one of the
specified 16-bit registers to form the jump destination address.
JMP @ A + DPTR
The special function registers have addresses between 80H and FFH. These addresses are
above 80H, since the addresses 00 to 7FH are addresses of RAM memory inside the 8051.
Not all the address space of 80 to FH is used by the SFR. The unused locations 80Hto FFH
are reserved and must not used by the 8051 programmer.
20. What is the difference between direct and register indirect addressing mode?
Loop is most efficient and is possible only in register indirect addressing whereas looping is
not direct addressing mode.
a. CJNE
b. CLR
c. CPL
24 Write a program to save the accumulator in r7 of bank 2.
CLR PSW – 3
SETB PSW – 4
MOV R7, A.
25. What are single bit instructions? Give example.
Instructions that are used for single bit operation are called single bit instructions
31
26. Write a program to save the status of bits p1.2 and p1.3 on ram bit locations 6 and 7
respectively.
29. What is the operation of the given 8051 microcontroller instructions: XRL A, direct
(April/May2011)
XRLA, Direct Exclusive OR operation with A register content and Direct value
32
31. Compare Microprocessor and Microcontroller. (Nov/Dec 2006,2011)
Access times for memory and Less access time for built-in memory
4 I/O devices are more and I/O devices
Vector address
• Serial Interrupt
33
33. List the 8051 instructions that affect the overflow flag.
34. List the 8051 instructions that always clear the carry flag.
35. List the 8051 instructions that affect all the flags. (NOV/DEC 2007)
36. What are the different types of ADC? (APR/MAY2008 NOV/DEC 2011)
The different types of ADC are successive approximation ADC, counter type ADC
flash type ADC, integrator converters and voltage to- frequency converters.
37. What is the necessity of interfacing DAC with microcontroller? (Nov/Dec 2014)
In many applications, the microcontroller has to produce analog signals for controlling
certain analog devices. Basically, the microcontroller can produce only digital signals. In
order to convert the digital signal to analog signal a Digital to Analog Converter has to be
employed.
38. Mention the number of register banks and their addresses in 8051? (Nov/Dec2015)
There are 4 register banks. They are Bank0, Bank1, Bank2& Bank3.
RAM locations from 00 to 07H for bank 0
RAM locations from 08 to 0FH for bank 1
RAM locations from 10 to 17H for bank 2
RAM locations from 18 to 1FH for bank 3
1. Immediate addressing
2. Register addressing
3. Direct addressing
4. Register indirect addressing
5. Indexed addressing
34
PART-B
1. With the necessary diagram of control word format, explain the various operating modes of
timer in 8051microcontroller (EE2354May/June2014) U
2. With the help of neat diagram explain the memory organization of 8051 microcontroller
(April/May2011)(Nov/Dec2014) U
3. With neat sketch explain the architecture/ functional block diagram of 8051
microcontroller. (Nov/Dec2010), (April/May2010) (Apr/May 2015) (8) (Nov/Dec2014) U
4. Draw the Pin Diagram of 8051 and explain the function of various signals. (Nov/Dec2010) U
5. List the various Instructions available in 8051 microcontroller and explain. (EE2354
May/June2014) C
Data Transfer Instructions (Nov/Dec2014)
Boolean variable Manipulation Instructions (May/June 2013)
6. (i) Explain the Data transfer instructions and Program control instructions of 8051
microcontroller. (8) (April/May2011) U
(ii) Write an assembly language program based on 8051 microcontroller instruction set to
Perform four arithmetic operations on 2, 8 bit data. (8) (April/May2011) C
7. Discuss about the organization of Internal RAM and Special function registers of 8051
Microcontroller in detail. (16) (April/May2011) U
8. Explain the arithmetic and control instructions of 8051microcontroller. (10) (April/May2015) U
9. (i) Explain the Interrupt structure with the associated registers in 8051 microcontroller. (8)
(April/May2011) (Nov/Dec2014) U
10. Explain the TMOD function register and its timer modes of operations.(8)
(April/May2015) U
11. Explain in detail about the special function register of 8051 in detail. NOV/DEC’15](8) U
12. Explain the different addressing modes of 8051.[NOV/DEC’15] U
13. Give PSW of 8051 and describe the use of each bit in PSW. [NOV/DEC’15] U
14. Describe the functions of the following signals in 8051. RST, EA, PSEN and ALE. U
[NOV/DEC’15]
15. Explain the architecture of 8051 with its diagram. (16)U [May/June 2016]
16. Write an 8051 ALP to create a square wave of 66% duty cycle on bit 3 of port 1. (16)
35
UNIT-V
INTERFACING MICROCONTROLLERS
PART-A
Serial data buffer is a special function register and it initiates serial transmission when byte is
written to it and if read, it reads received serial data. It contains two independent registers internally.
One of them is a transmit buffer, which is a parallel-in serial-out register. The other is a receive
buffer, which is a serial-in parallel-out register
Timer registers are two 16-bit registers and can be accessed as their lower and upper bytes.
TLO represents the lower byte of the timing register 0, while THO represents higher bytes of the
timing register 0. Similarly, TLI and THI represent lower and higher bytes of timing register 1. These
registers can be accessed using the addresses allotted to them, which lie in the special function
registers address range, i.e., 801 H to FF.
Timing and control unit is used to derive all the necessary timing and control signals required
for the internal operation of the circuit. It also derives control signals that are required for controlling
the external system bus.
The timer overflow bits are set when timer rolls over and reset either by the execution of an
RET instruction or by software, manually clearing the bits. The bits are located in the TCON register
along with timer run control (TRn) bits.
• Timer mode 0 and 1 operations are similar for the 13 bit (mode) or 16 bit (mode 1) counter.
When the timer reaches the limits of the count, the overflow flag is set and the counter is reset
back to zero. The modes 0 and 1 can be used to time external events.
36
• They can be used as specific time delays by loading them with an initial value before allowing
them to execute and overflow.
i. Capture mode: Timer 2 operates as free running clocks, which saves the timers value on each high
to low transition. It can be used for recording bit lengths when receiving Manchester-encoded data.
ii. Auto-reload mode: When the timer overflows, value is written into TH2/TL2 registers from RCA
P2H/RCA P21 registers. This feature is used to implement a system watch dog timer.
8. Define interrupt.
Interrupt is defined as request that can be refused. If not refused and when an interrupt request is
acknowledged, a special set of routine or events are followed to handle the interrupt.
There are five different ways to interrupt 8051. Two of these are from external electrical
signals. The other three are caused by internal 8051 I/O hardware operations.
The register is used to enable or disable all 8051 interrupts and to selectively enable or
disable each of the five different interrupts.
Nesting of interrupts means that interrupts are re-enabled inside an interrupt handler. If
another interrupt request codes in, while the first interrupt handler is executing, processor execution
will acknowledge the new interrupt and jump to its vector.
11. How is the 8051 serial port different from other micro controllers? (Nov/Dec2013)
The 8051 serial port is a very complex peripheral and able to send data synchronously and
asynchronously in a variety of different transmission modes.
• Txd pin is used for clock output, while Rxd pin is for data transfer.
• When a character is received, the status of the data transfer is monitored by polling the RI-n bit in
serial control register (SCON).
In 8051, during execution the data is fetched continuous. Most of the data is executed out of
the 8051‟sbuilt-in control store. When an address is outside the internal control store, an external
memory access is generated.
TF0 (Timer 0)
38
IE 1 (External INT 1)
TF 1 (Timer 1)
A stepper motor is a device used to obtain an accurate position control of rotating shafts. A
stepper motor employs rotation of its shaft in terms of steps, rather than continuous rotation as in
case of AC or DC motor.
Microprocessor must wait until the key reach to a steady state; this is known as Key bounce.
In this mode serial enters &exits through RXD, TXD outputs the shift clock.8 bits are
transmitted/received:8 data bits(LSB first).The baud rate is fixed at 1/12 the oscillator frequency.
19. Explain the operating mode2 of 8051 serial ports? (April/May 2009&Nov/Dec2008)
In this mode 11 bits are transmitted(through TXD)or received(through RXD):a start bit(0), 8
data bits(LSB first),a programmable 9th data bit ,& a stop bit(1).ON transmit the 9th data bit (TB* in
SCON)can be assigned the value of 0 or 1.Or for eg:, the parity bit(P, in the PSW)could be moved
into TB8.On receive the 9thdatabit go in to the RB8 in Special Function Register SCON, while the
stop bit is ignored. The baud rate is programmable to either 1/32or1/64 the oscillator frequency.
In this mode,11 bits are transmitted(through TXD)or received(through RXD):a start bit(0), 8
data bits(LSB first),a programmable9th data bit ,& a stop bit(1).In fact ,Mode3 is the same as Mode2
in all respects except the baud rate. The baud rate in Mode3 is variable. In all the four modes,
transmission is initiated by any instruction that uses SBUF as a destination register. Reception is
initiated in Mode0 by the condition RI=0&REN=1.Reception is initiated in other modes by the
incoming start bit if REN=1.
MOV A,#data
ANL A,#81
MOV DPTR,#4500
MOVX @DPTR,A
LOOP SJMP LOOP
39
22. Write about CALL statement in 8051?
MOV A,R0
CPL A
INC A
24. Define baud rate. (May/June 2016)
Baud rate is used to indicate the rate at which data is being transferred.
In this mode serial enters and exits through RXD, TXD outputs the shiftclock. 8 bits are transmitted
/received 8 data bits first (LSB first).The baudrate is fixed at 1/12 the oscillator frequency.
40
28. Compare polling and interrupt. (May/June 2016)
The 8051 microcontroller can do only one task at a time. In polling, the microcontroller continuously
checks each port one by one according to the priority assigned to the ports, and if any device requires
service, then it provides it. In interrupt, when the device requires service, it sends the request to
microcontroller and the controller then provides service to it.
So essentially, the difference is that in polling, microcontroller has to check continuously whether
any device is asking for request, while in interrupt the device itself sends the request and the
controller satisfies it. And because microcontroller is freed from the task of checking each port, it can
do other work.
PART-B
4. With neat sketch explain the function of Keyboard and display controller. (April/May2014) U
5. With neat sketch explain the function of A/D converter. (Nov/Dec 2014) U
6. With neat sketch explain the function of D/A converter. (Nov/Dec 2014) U
7. (i) Explain the interfacing of Keyboard/Display with 8051 microcontroller. (8) April/May2011) U
(ii) Explain the Servomotor control using 8051 microcontroller. (8) (April/May2011) U
8. (i) Explain in detail the modes of operation of Timer unit in 8051 microcontroller. (8)
(April/May2011) U
9. Explain the Stepper motor control using 8051 microcontroller. (8)(April/May2011)
(Nov/Dec2014) U
10. Using 8051 timer/Counter write a program for generating square wave of 100 ms and
50% duty cycle and Explain (April/May2011)(Nov/Dec2014)(Nov/Dec2010) C
12. Describe the different modes of operation of timers/counters in 8051 with its associated
register.(April/May2015) (10) R
13. How does one interface a 16 x 2 LCD display using 8051 microcontroller.
(April/May2015) (6). A/E
14. Draw the diagram to interface a stepper motor with 8051 microcontroller and explain. Write
a 8051 assembly language program to run the stepper motor in both forward and reverse
direction with delay. (16). (April/May2015). C
41
15. How to interface an LCD display with microcontroller? Explain how to display a
character using LCD display. (Nov/Dec 2014). (8) A/E
16. Draw the schematic for interfacinga stepper motor with 8051microcontroller and write 8051 ALP
for keypad scanning. [NOV/DEC'15][APR/MAY'15] C
17. With a neat circuit diagram explain how a 4x4 keypad is interfaced with 8051 microcontroller
and write 8051 ALP for keypad scanning.[NOV/DEC'15][MAY/JUNE’13] U
18. Draw the diagram to interface a stepper motor with 8051 microcontroller and Write its ALP to
run the stepper motor in both forward and reverse direction with delay.(16)[May/June 2016]
19. Explain 8051 serial port programming with examples. (16)[May/June 2016]
42