Ec6504 Mpandmc QB
Ec6504 Mpandmc QB
com
DEPARTMENT OF ECE
QUESTION BANK
Subject Code: EC6504
Subject Name: MICROPROCESSORS AND MICROCONTROLLERS
UNIT-I
PART-A
1. Define microprocessors?
technique. It includes the ALU, register arrays, and control circuits on a single
chip.
2. Define microcomputer?
3. Define ROM?
4. What is an ALU?
The group of circuit that provides timing and signals to all operation in the
www.vidyarthiplus.com
www.vidyarthiplus.com
6. What is an Assembler?
1. Memory read
2. Memory write
3. I/O read
4. I/O write
A group of lines that are used to send a memory address or a device address
from the MPU to the memory location or a peripheral. The 8085 microprocessor
address lines?
14
=16,384
The data bus is bi-directional because the data flow in both directions
The accumulator is the register used to store the 8-bit data to perform the
www.vidyarthiplus.com
www.vidyarthiplus.com
This is single line that is generated by the MPU to provide timing of various
operations.
14. Why are the program counter and the stack pointer 16-bit registers?
Memory locations for the program counter and stack pointer have 16-dit
16. Specify the number of registers and memory cells required in a 128 x 4
memory chip?
Number of registers=128
17. Explain the function of ALU and IO/M signals in the 8085 architecture?
The ALU signal goes high at the beginning of each machine cycle indicating
the availability of the address on the address bus, and the signal is used to latch the
low-order address bus. The IO/M signal is a status signal indicating whether the
machine cycle is I/O or memory operation. The IO/M signal is combined with the
18. If the 8085 adds 87H and 79H, specify the contents of the accumulator and the
The sum of 87H and 79H=100H. Therefore, the accumulator will have 00H,
www.vidyarthiplus.com
www.vidyarthiplus.com
clock period.
22. What is a transparent latch? Why is it necessary to latch with output devices
such as LED’s?
the clock signal is high, and it latches the input on the trailing edge of the clock.
The latch is necessary for output devices to return the result; otherwise the result
will disappear.
D7 D6 D5 D4 D3 D2 D1 D0
the instruction.
www.vidyarthiplus.com
www.vidyarthiplus.com
(ii)Write an 8086 ALP to find the sum of numbers in the array of 10 elements?
6. Define interrupt and their two classes? Writein detail about interrupt service routine?
9. Write an ALP to find the largest number and smallest number in the array?
UNIT-II
A Z AC P CY
o Arithmetic operations
o Logical operations
o Branching operations
called operand.
www.vidyarthiplus.com
www.vidyarthiplus.com
Jump: to test the conditions Call, Return, And Restart: Change the
In a 2-byte instruction, the first byte specifies the Opcode; the second
MVI A, Data
6. Write instructions to load the hexadecimal numbers 65H in register C, and 92h
in the accumulator A .Display the number 65H at PORT0 and 92H at PORT1?
MVI C, 65H
MVI A, 92H
HLT
The instruction ADD a will add the content of the accumulator to itself;
8.What operation can be performed by using the instruction SUB A? Specify the
The instruction SUB a will clear the accumulator. The flag status will
www.vidyarthiplus.com
www.vidyarthiplus.com
MVI A, 00H (A = 0 0 0 0 0 0 0 0
DCR A - 0 0 0 0 0 0 0 1
HLT
HLT: Halt
NOP: No Operation
The data transfer instructions copy data from one source in to a destination
M=memory register
Rs = Register source
Rd = register destination
Rp = register pair
www.vidyarthiplus.com
www.vidyarthiplus.com
o Rotate
o Compare
o Complement
In a three-byte instruction, the first byte specifies the Opcode, and the
Copy the data from the accumulator in the memory location specified by
This is a 2-byte instruction. It accepts data from the input port specified in
www.vidyarthiplus.com
www.vidyarthiplus.com
JNZ change the program sequence to the location specified by the 16-bit
The instruction set is classified in three groups according to the word size:
1-byte instruction
2-byte instruction
3-byte instruction
Part-B
www.vidyarthiplus.com
www.vidyarthiplus.com
(ii) Coprocessor(4)
(iii) Multiprogramming(4)
(iv) Semaphore(4)
UNIT-III
1. I/O mode.
2. BSR mode.
In I/O mode, the 8255 ports work as programmable I/O ports, while In BSR mode only
port C (PC0-PC7) can be used to set or reset its individual port bits. Under the IO mode
of operation, further there are three modes of operation of 8255, So as to support different
Two 8-bit ports (port A and port B) and two 4-bit ports (port C upper and lower) are
available. The two 4-bit ports can be combined used as a third 8- bit port
Any port can be used as an input or output port.
3.Output ports are latched. Input ports are not latched.
A maximum of four ports are available so that overall 16 I/O configurations are possible.
www.vidyarthiplus.com
www.vidyarthiplus.com
Two groups – group A and group B are available for strobed data transfer.
Each group contains one 8-bit data I/O port and one 4-bit control/data port.
The 8-bit data port can be either used as input or output port. The inputs and
outputs both are latched.
3. Out of 8-bit port C, PC0-PC2 is used to generate control signals for port B and
PC3=PC5 are used to generate control signals for port A. The lines PC6, PC7 may be
4.What are the signals used in input control signal & output control
signal?
INTR(Interrupt request)
INTR(Interrupt request)
www.vidyarthiplus.com
www.vidyarthiplus.com
Each of the three counters of 8253 can be operated in one of the following
The control word register accepts data from the data buffer and initializes the
counters, as required. The control word register contents are used for
The mode control register is a write only register and the CPU cannot read its
contents.
www.vidyarthiplus.com
www.vidyarthiplus.com
The scan counter has two modes to scan the key matrix and refresh the display. In the encoded
mode, the counter provides binary count that is to be externally decoded to provide the scan lines
for keyboard and display. In the decoded scan mode, the counter internally decodes the least
significant 2 bits and provides a decoded 1 out of 4 scan on SL0-SL3.The keyboard and display
both are in the same mode at a time.
8279 provides two output modes for selecting the display options.
1.Display Scan
2.Display Entry
8279 allows options for data entry on the displays. The display data is entered
for display from the right side or from the left side.
www.vidyarthiplus.com
www.vidyarthiplus.com
In the left entry mode, the data is entered from the left side of the display unit.
In the right entry mode, the first entry to be displayed is entered on the rightmost display.
The modem control unit handles the modem handshake signals to coordinate the communication
between the modem and the USART.
The 8257 perform the DMA operation over four independent DMA channels. Each of the four
channels of 8257 has a pair of two 16-bit registers. DMA address register and terminal count
register. Also, there are two common registers for all the channels; namely, mode set registers
and status register. Thus there are a total of ten registers. The CPU selects one of these ten
registers using address lines A0- A3.
Each DMA channel has one DMA address register. The function of this register is to store the
address of the starting memory location, which will be accessed by the DMA channel. Thus the
starting address of the memory block that will be accessed by the device is first loaded in the
DMA address register of the channel. Naturally, the device that wants to transfer data over a
DMA channel, will access the block of memory with the starting address stored in the DMA
Address Register.
Each of the four DMA channels of 8257 has one terminal count register. This 16-bit register is
used for ascertaining that the data transfer through a DMA channel ceases or stops after the
required number of DMA cycles
www.vidyarthiplus.com
www.vidyarthiplus.com
The mode set register is used for programming the 8257 as per the requirements of the system.
The function of the mode set register is to enable the DMA channels individually and also to set
the various modes of operation.
An interface is a shared boundary between the devices which involves sharing information.
Interfacing is the process of making two different systems
I.O Mode
It is a word stored in a register (control register) used to control the operation of a program
digital device.
22. What is the purpose of control word written to control register in 8255?
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.
Port-A : 8-bits
Port-B : 8-bits
Port-CU : 4-bits
Port-CL : 4-bits
as memory mapping.
www.vidyarthiplus.com
www.vidyarthiplus.com
Ans:The assignment of addresses to various I/O devices in the memory chip is called as
I/O mapping.
8251 chip is mainly used as the asynchronous serial interface between the processor and the
external equipment.
28.What is 8279?
a. Keyboard section
b. Scan section
c. Display section
PART-B
UNIT-IV
A device which contains the microprocessor with integrated peripherals like memory, serial
ports, parallel ports, timer/counter, interrupt controller, data acquisition interfaces like ADC,
www.vidyarthiplus.com
www.vidyarthiplus.com
• Register addressing
• Register indirect
• Immediate
• Register specific
• index
4. State the function of RS1 and RS0 bits in the flag register of Intel 8051
microcontroller?
0 0 Bank 0
0 1 Bank 1
1 0 Bank 2
1 1 Bank 3
5.Give the alternate functions for the port pins of port3?[APR/MAY 2011]
www.vidyarthiplus.com
www.vidyarthiplus.com
EA: EA stands for external access. When the EA pin is connected to Vcc, program fetched to
addresses 0000H through 0FFFH are directed to the internal ROM and program fetches to
addresses 1000H through FFFFH are directed to external ROM/EPROM. When the EA pin is
grounded, all addresses fetched by program are directed to the external ROM/EPROM.
DPTR: DPTR stands for data pointer. DPTR consists of a high byte (DPH) and a low byte
(DPL). Its function is to hold a 16-bit address. It may be manipulated as a 16-bit data register or
as two independent 8-bit registers. It serves as a base register in indirect jumps, lookup table
SP: SP stands for stack pointer. SP is a 8- bit wide register. It is incremented before data is stored
during PUSH and CALL instructions. The stack array can reside anywhere in on-chip RAM. The
stack pointer is initialised to 07H after a reset. This causes the stack to begin at location 08H.
• Accumulator
www.vidyarthiplus.com
www.vidyarthiplus.com
• B Register
• Stack Pointer.
• Data Pointer.
• Port 0
• Port 1
• Port 2
• Port 3
Microcontroller is a device that includes microprocessor; memory and I/O signal lines on a
single chip, fabricated using VLSI technology. Microcomputer is a computer that is designed
SCT-DEPARTMENT OF ECE
www.vidyarthiplus.com
www.vidyarthiplus.com
circuit.
builtin
counters.
are more.
I/O devices.
more hardware.
www.vidyarthiplus.com
www.vidyarthiplus.com
Vector address
• Serial Interrupt
14. Explain the contents of the accumulator after the execution of the following program
segments:
MOV A, #3CH
• The 8051 LIFO: Stack can reside anywhere in the internal RAM.
• It has 8 bit stack pointer to indicate the top of the stack using PUSH and POP
instructions.
one.
16. List the 8051 instructions that affect the overflow flag.
17. List the 8051 instructions that always clear the carry flag.
www.vidyarthiplus.com
www.vidyarthiplus.com
18. List the 8051 instructions that affect all the flags.[NOV/DEC 2007]
The different types of ADC are successive approximation ADC, counter type ADC flash type
ANL A, R4
A = 3C
R4 = 66
PART-B
2. Explain the I/O pins ports and circuit details of 8051 with its diagram.
4. With example explain the arithmetic and logic instruction of 8051 microcontroller.
6. Write a program based on 8051 instruction set to pack array of unpacked BCD digits.
8. Write a program to bring in data in serial form and send it out in parallel form using 8051
10. Explain about the register banks and special function register of 8051 in detail
Unit-v
PART-A
1.What is Microcontroller?
Microcontroller incorporates all the features that are found in microprocessor with the added
features of in-built ROM, RAM, Parallel I/O, Serial I/O, counters and clock circuit to make a
micro computer system on its own.
www.vidyarthiplus.com
www.vidyarthiplus.com
P3.0-RXD
P3.1-TXD
P3.2-INT0
P3.3-INT1
P3.4-T0
P3.5-T1
P3.6-WR
P3.7-RD
In mode 1, if SM2 = 1, RI will not be activated if a valid stop bit was not received.
4.If a 12 Mhz crystal is connected with 8051, how much is the time taken for the count in timer 0
T = 1/f
The overall system cost is low , as the peripherals are integrated in a single chip.
www.vidyarthiplus.com
www.vidyarthiplus.com
The IP register is used to set high priority to one or more interrupts in 8051.
Setting a bit to 1 makes the corresponding interrupt to have high priority and setting a bit to 0
makes the corresponding interrupt to have low priority.
The 8051 operations that do not use the internal 128 byte RAM address from 00 H to 7F H are
done by a group of special internal registers called SPFs(Special Function Registers) Which have
address between 80 H and FF H.
Baud rate is used to indicate the rate at which data is being transferred . Baud rate = 1/Time for a
bit cell.
External interrupt-0 , External interrupt-1,Timer-0 interrupt, Timer-1 interrupt, and serial port
interrupt.
ROM ,RAM ,Parallel I/O , Serial I/O , Counters, and a clock circuit are available.
The data pointer register (DPTR) is the 16 bit address register that can be used to fetch any 8 bit
data from the data memory space. When it is not being used for this purpose, it can be used as
two eight bit registers , DPH and DPL.
8 bit PSW
www.vidyarthiplus.com
www.vidyarthiplus.com
32 input / output pins arranged as four 8 bit ports :Port0, port1, port2 and port3.
TMOD (timer mode) register is used to set the various timer operation modes . TMOD is
dedicated to the two timers (Timer0 and Timer1) and can be considered to be two duplicate 4 bit
registers, each of which controls the action of one of the timers
Peripheral devices(printer)
TIMER 1 TIMER 0
M1 M0 Mode
www.vidyarthiplus.com
www.vidyarthiplus.com
Timer 0
Timer 1
Each 16 bit timer is accessed as two separate 8 bit registers : Low byte register(TL) and High
byte register
(TH).
SWAP instruction works only on the accumulator (SWAP A) . It swaps the lower nibble and
higher
nibble .The lower 4 bits are put into the higher 4 bits and the higher 4 bits are put into the lower
4 bits.
E.g.- SWAP A
ACC
hardware interrupt 1
PART-B
1. Draw the diagram to interface a stepper motor with 8051 microcontroller and explain also write an
8051 ALP to run the stepper motor in both forward and reverse direction with delay.
www.vidyarthiplus.com
www.vidyarthiplus.com
9. Explain the keyboard interfacing using 8051 10. Explain the sensor interfacing using 8051
www.vidyarthiplus.com