Microprocessor and Microcontroller Interview Questions and Answers:
Following are the below Microprocessor and Microcontroller Interview Questions and Answers, Microprocessor and Microcontroller Important Questions and Answers
1. State the use of ALE signal in 8085.
Ans. Address latch enable signal is used primarily to latch the low order address from the multiplexed bus and generate a separate set of eight address lines A7Â – A0.
2. List the five interrupt pins available in 8085.
Ans. 8085 processor have five interrupt inputs:
(a) TRAP (b) RST 7.5 (c) RST 6.5 (d) RST 5.5 (e) INTR.
3. Mention the instructions used for data transfer with input/output parts.
Ans. The input/output instruction of 8085 are
IN addr 8 – input a data byte from the Input/Output mapped device or port.
OUT addr 8 – output a data byte to Input/Output mapped device or port.
4. Differentiate CALL instruction from JUMP instruction.
Ans. In CALL instruction, the address of next instruction is pushed to stack before transferring the program control to call address.
But in JUMP instruction, the address of next instruction is not saved.
5. Name the peripheral ICs used for parallel and serial data transfer.
Ans. The INTEL 8255 is a device used to implement parallel data transfer between processor and slow peripheral devices.
The 8251A is a programmable serial communication interface chip designed for synchronous and asynchronous serial data communication.
6. What is the cascaded mode of 8259 programmable interrupt controller?
Ans. In cascade mode, slave 8259s are connected to one or more IR input of master 8259 and each slave is provided with a slave ID number.
7. Give the memory size of 8051 microcontroller.
Ans. The program memory space of 8051 microcontroller can be up to 60k bytes long.
8. List the different types of 8051 instructions.
Ans. Instruction set of 8051 controller is divided into five functional groups.
- Data transfer instructions
- Arithmetic instructions
- Logical instructions
- Control transfer or Branching instructions
- Boolean or Bit Manipulation instructions.
9. What do you understand by the term “program status word” and state how it can be read?
Ans. Program status word have two bits specify which register bank is in use currently. The program status word of 8051 controller is shown below:
10. Differentiate the 2 key lockout from N key roll over mode of 8279.
Ans.
N-key rollover mode: Simultaneous keys are recognized and their codes are stored in FIFO.
2-key lockout mode: If two keys are pressed simultaneously, only the first key is recognized.
11. List the steps involved in interfacing a memory to the 8085 microprocessor.
Ans.
- Check the set values of IÌ…OÌ…/M value.
- If the memory or interfacing value is 1, then memory conditions begins and interface with MPU.
- If value is 0, Input/Output operation occurs with the MPU.
12. What are on-chip resources? List those available in the 8051 microcontroller.
Ans. 8051 microcontroller has an in-built on-chip oscillator circuit, single stage linear inverter. XTAL 1 and XTAL 2 are the input and output of a single stage on-chip inverter. To oscillate it external crystal having frequency of 12 MHz is used.
13. What do you understand by bit addressable RAM in 8051 microcontroller?
Ans. The next 16 bytes [20H to 2FH] above the register banks of the 128 bytes internal RAM form a block of bit-addressable memory space. The bits can be referred by two ways:
- by their direct address (00 to 7FM).
- with reference to bytes 20H to 2FH.
14. Qualify the number of register banks in 8051 and say how the CPU knows which bank is currently in use.
Ans. The lowest 32 bytes of lower 128 bytes internal RAM are grouped in 4 banks, each consists of 8-one byte register denoted as R0Â – R7 with 00H to 1FH addresses.
15. Justify your choice between UV-EPROM and flash EPROM for an external ROM in an 8051 microcontroller application.
Ans. Flash EPROM erases whole memory. UV-EPROM erases only a specified part in the memory. Hence for an external ROM in an 8051 microcontroller application UV-EPROM is an best choice.
16. Specify the size of data, address, memory word and memory capacity of 8085 microprocessor.
Ans. 8085 has
- S data lines [D0Â – D7]
- 16 address lines [A0Â – A15]
- 216 memory word.
- 64 kB of memory.
17. How is the memory segment accessed by 8086 microprocessor identified?
Ans. The phyiscal address of 8086 is 20 bits wide to access 1 megabyte memory location, whereas the registers and memory locations which contain logical address at 16 bit wide. So by using segment registers, we access 20 bits.
18. State the function of give 8085 instructions: JP, JPE, JPO, JNZ.
Ans.
- JP = jump if plus (SF = 0)
- JPE = jump if parity even (PF = 1)
- JPO = jump if parity odd (PF = 0)
- JNZ = jump if non-zero (ZF = 0)
19. What are the different ways to end the interrupt execution in 8259 programmable interrupt controller?
Ans.
- Automatic end of interrupt.
- Specific end of interrupt.
- No-specific end of interrupt.
20. What is the function of scan section in 8279 programmable keyboard/display controller?
Ans. The scan section has a scan counter, that operates in two modes,
Encoded Mode:Â Scan counter provides a binary count from 0000 to 1111 on the four scan lines (SC3Â – SC0) with active high outputs.
Decoded Mode:Â Decoder decodes the least significant 2 bits of binary count and provides four possible combinations on the scan lines (SC3Â – SC0) with active low outputs.
21. Mention the size of DPTR and Stack Pointer in 8051 microcontroller.
Ans.
Stack Pointer – 8 bit register.
DPTR – 16 bit register.
It can be used as high byte (DPH) and a low byte (DPL).
22. What is the operation of the given 8051 microcontroller instruction : XRL A, direct?
Ans. XRL A, direct – Exclusive – OR direct byte to accumulator.
23. What are the different operations performed by Boolean variable instructions of 8051?
Ans.
- Set carry flag,
- Clear carry flag,
- Complemented carry flag,
- Set direct bit,
- Clear direct bit,
- Complement direct bit,
- AND direct bit to carry flag,
- OR direct bit to carry flag
- Move direct bit to carry flag.
24. Draw the schematic diagram of latching low-order address bus in 8085 microprocessor.
Ans.
The lower byte of address is available on the multiplexed address/data bus(AD0 – AD7) during T1 data of each machine cycle, except has idle machine cycle.
25. Why do we need look-up table?
Ans. Look-up table in a memory location placed in the register of a microprocessor. It is used to transform the input data into a more desirable output format.
26. How are the 8085 instructions classified according to the functional categories?
Ans.
- Data Transfer Instructions. Example: MOV B, D.
- Arithmetic Instructions. Example: ADD M.
- Logical Instructions. Example: ORA M.
- Branching Example: JMP 2000 H.
- Machine Control Instructions. Example: PUSH D.
27. State the use of ISR and PR registers in 8259 PIC.
Ans. The In-Service Register [ISR] stores all the levels that are currently being serviced. Priority Resolver [PR] examines In-Series Register (ISR).
Interrupt mark Register and Interrupt Request Register (IRR) and determines whether interrupt should be sent to the MPU.
28. Link the on-chip peripherals of 8051 microcontroller.
Ans.
- Single supply +5 volts operation using HMOS technology.
- 4096 bytes program memory on chip.
- 128 data memory on chip.
- Four register bank, Two multiple code, 16-bit Timer/Counter.
- Extensie boolean processing capabilities.
- 64kB external RAM size.
- 32 bi-directional individually addressable input/output lines.
- 8-bit CPU optimized for control applications.
29. Why do we need opto-isolator circuit between microcontroller and the stepper motor?
Ans. The microcontroller pins do not provide sufficient current to drive the stepper motor. Therefore opto-isolator circuit are used as drivers. They can supply higher current to the motor.
30. What is the function of Program Counter in 8085 microprocessor?
Ans. Program counter is a 16-bit register. It is used to hold the address of the instruction which is to be executed next.
31. How many address and data lines are used in 8086 microprocessor?
Ans. 8086 microprocessor has
- 20 address lines [A0 – A19]
- 16 data lines [D0 — D15]
32. What is the different machine control instructions used in 8085 microprocessor?
Ans. Machines Control Instructions:
33. What is the function of stack?
Ans. Stack is a sequence of RAM memory locations defined by the programmer.
34. What are the different peripheral interfacing need with 8085 microprocessor?
Ans.
- 8255 PPI (Programmable Peripheral Interface)
- 8251 USART Serial Communication
- 8253 Timer
- 8279 Keyboard/Display Controller
- 8259 Interrupt Controller
35. What are the output terminals in USART 8251?
Ans. The output terminals in USART are:
- Transmit buffer (T x D)
- Transmit control (T x RDY T x EMPTY)
- Receive control (R x RDY)
36. What is the function of B registers in 8051 microcontroller?
Ans. B register is used for multiplication and division operations. At the time of execution, it keeps one of the 2 inputs and the portion of the result is retained in the register.
37. How is pulse generated from microcontroller for stepper motor control?
Ans. The switching sequence to step the motor in clockwise or anticlockwise direction by generating pulses from microcontroller.
38. What are the various flags used in 8085?
Ans.
- Zero Flag (Z)
- Auxiliary Carry Flag (AC)
- Parity Flag (P)
- Carry Flag (CY)
- Sign Flag (S)
39. What is ALE?
Ans. ALE means Address Latch enable. This signal is used to demultiplex the data.
40. What are the instructions associated with a subroutine?
Ans.
- CALL.
- RETURN.
41. What is the need for 8259 PIC?
Ans. In 8085, we have 5 interrupt pins (RST 5.5, RST 6.5, RST 7.5, INTR, TRAP). When processor interrupts are insufficient we have to use an external device called priority interrupt controller. 8259 can accept 8 interrupt requests of external devices and allows one by one to the processor through INTR.
42. What are the basic modes of operation of 8255?
Ans.
- BSR (Bit Set/Reset) mode.
- I/O (Input or Output) mode.
43. What is instruction pipelining?
Ans. Pipelining instruction is that the Execution Unit (EU) can execute instructions almost continually in the order they have stored in the queue instead of having to wait for BIU to fetch the new instruction.
44. What is the purpose of overflow flag in 8051 microcontroller?
Ans. If there is any overflow in the result, the OF is set (OF = 1), otherwise it is reset (OF = 0).
45. What are the the functions of the READY and ALE signals of 8085?
Ans.
READY: It is an input signal to the processor, used by the memory or input/output devices to get extra time for data transfer or to introduce wait states in the bus cycles.
ALE: It is a signal used to demultiplex the address and data lines, using an external latch.
46. What are the use of CALL and RET instructions of 8085?
Ans.
CALL: It is used as starting address of the subroutine program.
RET: It is used for return to main program.
47. What are the addressing modes supported in 8085?
Ans.
- Direct addressing mode
- Indirect addressing mode
- Immediate addressing mode
- Register addressing mode
- Implicit addressing mode.
48. Discuss the BSR mode of operation of 8255.
Ans. If D7th bit of control word is set to “LOW”, the 8255 IC operates under BSR mode.
49. What are the addressing modes of 8051 microcontroller?
Ans. The addressing modes are
- Immediate addressing mode
- Register addressing mode
- Register indirect addressing mode
- Direct addressing mode
- Indirect addressing mode.
50. What are the interrupts of 8051?
Ans.
- External Interrupt 0
- Timer Interrupt 0
- External Interrupt 1
- Timer Interrupt 1
- Serial Port Interrupt.
51. What are the uses of LCALL and LJUMP instructions of 8051?
Ans.
LCALL – long call, call the subroutine located anywhere in the program memory space.
LJUMP – Long Jump, it causes an unconditional branch to the target location.
52. What is Tri-state logic?
Ans. The Tristate logic devices have three states logic 1, logic 0 high impedance. A tristate logic has a third line called Enable.
53. What are the Hardware interrupts?
Ans. The 8085 has five Hardware interrupts signals RST 5.5, RST 6.5, RST 7.5 Trap and INTR.
54. How the instruction sets are grouped?
Ans. Five functional categories.
- Data transfer operations.
- Arithmetic operations.
- Logical operations.
- Branching operations.
- Machine control operations and Stack input/Output.
55. What are the ports available in 8255? What is the advantage of the third port?
Ans. There are three ports are available
1) Port AÂ Â 2) Port BÂ Â 3) Port C.
Port C can be splitted into two parts and each can be used in control signals for ports A and B in the handshaking Mode. It can be programmed for bit set/reset operation.
56. What is meant by Interrupt Mask Register in 8259?
Ans. Interrupt Mask Register (IMR) stores the masking bits of the interrupt lines to be Masked. This register can be programmed by an Operation Command Word (OCW). An interrupt which is Masked by Software will not be recognised and serviced even if it sets the corresponding bits in the Interrupt request register.
57. What are the flags available in 8051?
Ans.
- Carry flag.
- Auxiliary carry flag.
- Oveflow flag.
- Parity flag.
- Select the Working register Bank RS0, RS1.
58. What is meant by SFR in 8051?
Ans. Unlike other microprocessors, in the intel family, 8051 uses memory maped input/output through a set of special function registers that are implemented in the address space immediately above the 128 bytes of RAM.
59. What is TRAP interrupt and its significance?
Ans. TRAP is the non-markable and the highest piority interrupt. If TRAP is enabled, the microprocessor completes the execution of current instruction, pushes the PC content into stack and branches to location OO24H.
60. Define the function of parity flag and zero flag in 8085.
Ans.
Parity Flag (P): This flag is set to 1, if arithmetic instruction gives even number of 1’s. Flag is zero, if arithmetic instruction gives odd number of 1’s with odd parity.
Zero Flag (Z): This flag is set to 1 whenever an arithmetic operation produces a result of 0. The zero flag is cleared to 0 for a non-zero result due to an arithmetic operation.
61. What is the use of branching instructions?
Ans. Branch instructions instruct the microprocessor to change the program sequence to some other memory location and the microprocessor continues execution of new mnemonics at new location.
The instructions are
- Unconditional branch instruction [JMP].
- Conditional branch instruction [JZ, JNZ, JP, JM, JC].
- Subroutine related branch instruction [CALL, RET].
62. What are the applications of D/A converter interfacing with 8255?
Ans. Using DAC, analog waveforms like square waveforms, ramp waveforms and triangular waveforms are generated.
63. What is keyboard interfacing?
Ans. 8279 is a programmable keyboard interface provides a hardware approach for interfacing the matrix keyboard and a multiplexed display to CPU.
64. What are the main features of 8051 microcontroller?
Ans.
- Single supply +5 volt operation using HMOS technology.
- 4096 bytes program Memory on chip.
- 128 data memory on chip.
- Four register banks.
- Two multiple mode 16 bit Timer/Counter.
- 64 KB external RAM size.
- 32 bi-directional individually addressable I/O lines.
- 8 bit CPU optimized for control applications.
65. What are the applications of 8051 microcontroller?
Ans.
- Energy Management: Controlling energy usage in homes and industrial application by metering system.
- Touch Screens: Cell phones, media players and gaming devices.
- Automobiles: Hybrid vehicles to manage engine variants.
- Medical Devices: Blood Pressure, Glucose monitors.
66. Write the functional aspects of execution unit in an 8086 architecture.
Ans. The execution unit contains.
- Control circuitry (directing the internal operations).
- 16 bit arithmetic logic unit.
- 16 bit flag register.
- 8 bit general purpose register.
- Base pointer and stack pointer.
- 16 bit SI and DI (used to hold 16-bit offset of a data word in one of the segments).
67. What is a stack in an 8085 micro computer system?
Ans. Stack is a sequence of RAM memory locations defined by the programmer.
68. What is indexing?
Ans. Indexing is a register used for modifying operand addresses during the run of a program, typically for doing vector/array operation.
69. Draw the 3-bit Digital to Analog converter block and plot and its anlog output.
Ans.
70. What does the Mnemonics “LCALL” and “ACALL” stands for?
Ans.
LCALL — Long Call.
ACALL — Absolute Call.
71. Give an example for DA instruction of 8051 microcontroller.
Ans.
MOV R0, 42h ⇒ Move the constant of RAM location 42h to R0.
MOV 55h, A ⇒ Move the content of A into RAM location 55h.