Micro-controller Multiple Choice Questions & Answers (MCQs) “Introduction to Microcontroller”.

1. A microcontroller at-least should consist of:

a) RAM, ROM, I/O ports and timers
b) CPU, RAM, I/O ports and timers
c) CPU, RAM, ROM, I/O ports and timers
d) CPU, ROM, I/O ports and timers

Answer: c
Explanation: A microcontroller at-least consists of a processor as its CPU with RAM, ROM, I/O ports and timers. It may contain some additional peripherals like ADC, PWM, etc.

2. Unlike microprocessors, microcontrollers make use of batteries because they have:
a) high power dissipation
b) low power consumption
c) low voltage consumption
d) low current consumption

Answer: b
Explanation: Micro Controllers are made by using the concept of VLSI technology. So here, CMOS based logic gates are coupled together by this technique that consumes low power.

3. What is the order decided by a processor or the CPU of a controller to execute an instruction?
a) decode,fetch,execute
b) execute,fetch,decode
c) fetch,execute,decode
d) fetch,decode,execute

Answer: d
Explanation: First instruction is fetched from Program Memory. After fetching, instruction is decoded to generate control signals to perform the intended task. After decoding, instruction is executed and the complete intended task of that particular instruction.

4. If we say microcontroller is 8-bit then here 8-bit denotes size of:
a) Data Bus
b) ALU
c) Control Bus
d) Address Bus

Answer: b
Explanation: If we say a microcontroller is 8-bit it means that it is capable of processing 8-bit data at a time. Data processing is the task of ALU and if ALU is able to process 8-bit data then the data bus should be 8-bit wide. In most books it tells that size of data bus but to be precise it is the size of ALU because in Harvard Architecture there are two sets of data bus which can be of same size but it is not mandatory.

5. How are the performance and the computer capability affected by increasing its internal bus width?
a) it increases and turns better
b) it decreases
c) remains the same
d) internal bus width doesn’t affect the performance in any way

Answer: a
Explanation: As the bus width increases, the number of bits carried by bus at a time increases as a result of which the total performance and computer capability increases.

6. Abbreviate CISC and RISC.
a) Complete Instruction Set Computer, Reduced Instruction Set Computer
b) Complex Instruction Set Computer, Reduced Instruction Set Computer
c) Complex Instruction Set Computer, Reliable Instruction Set Computer
d) Complete Instruction Set Computer, Reliable Instruction Set Computer

Answer: b
Explanation: CISC means Complete Instruction Set Computer because in this a microcontroller has an instruction set that supports many addressing modes for the arithmetic and logical instructions, data transfer and memory accesses instructions. RISC means Reduced Instruction Set Computer because here a microcontroller has an instruction set that supports fewer addressing modes for the arithmetic and logical instructions and for data transfer instructions.

7. Give the names of the buses present in a controller for transferring data from one place to another?
a) data bus, address bus
b) data bus
c) data bus, address bus, control bus
d) address bus

Answer: c
Explanation: There are 3 buses present in a microcontroller they are data bus (for carrying data from one place to another), address bus (for carrying the address to which the data will flow) and the control bus (which tells the controller to execute which type of work at that address may be it read or write operation).

8. What is the file extension that is loaded in a microcontroller for executing any instruction?
a) .doc
b) .c
c) .txt
d) .hex

Answer: d
Explanation: Microcontrollers are loaded with .hex extension as they understand the language of 0’s and 1’s only.

9. What is the most appropriate criterion for choosing the right microcontroller of our choice?
a) speed
b) availability
c) ease with the product
d) all of the mentioned

Answer: d
Explanation: For choosing the right microcontroller for our product we must consider its speed so that the instructions may be executed in the least possible time. It also depends on the availability so that the particular product may be available in our neighboring regions or market in our need. It also depends on the compatibility with the product so that the best results may be obtained.

10. Why microcontrollers are not called general purpose computers?
a) because they have built in RAM and ROM
b) because they design to perform dedicated task
c) because they are cheap
d) because they consume low power

Answer: b
Explanation: Microcontrollers are designed to perform dedicated tasks. While designing general purpose computers end use is not known to designers.

This set of Micro-controller Multiple Choice Questions & Answers (MCQs) focuses on “Von Neumann and Harward Architectures”.

1. How many types of architectures are available, for designing a device that is able to work on its own?
a) 3
b) 2
c) 1
d) 4

Answer: b
Explanation: There are basically two main types of architectures present, they are Von Neumann and Harvard architectures.

2. Which architecture is followed by general purpose microprocessors?
a) Harvard architecture
b) Von Neumann architecture
c) None of the mentioned
d) All of the mentioned

Answer: b
Explanation: General purpose microprocessors make use of Von Neumann architecture as here a simpler design is offered.

3. Which architecture involves both the volatile and the non volatile memory?
a) Harvard architecture
b) Von Neumann architecture
c) None of the mentioned
d) All of the mentioned

Answer: a
Explanation: In Harvard architecture, both the volatile and the non volatile memories are involved. This is done to increase its efficiency as both the memories are being used over here.

4. Which architecture provides separate buses for program and data memory?
a) Harvard architecture
b) Von Neumann architecture
c) None of the mentioned
d) All of the mentioned

Answer: a
Explanation: Harvard Architecture provides separated buses for data and program memory to fetch program and data simultaneously. By doing this access time is reduced and hence performance is increased.

5. Which microcontroller doesn’t match with its architecture below?
a) Microchip PIC- Harvard
b) MSP430- Harvard
c) ARM7- Von Neumann
d) ARM9- Harvard

Answer: b
Explanation: MSP430 supports Von Neumann architecture.

6. Harvard architecture has _____________
a) dedicated buses for data and program memory
b) pipeline technique
c) complex architecture
d) all of the mentioned

Answer: d
Explanation: Harvard Architecture has dedicated buses for data and program memory and pipeline technique because of this architecture is complex.

7. Which out of the following supports Harvard architecture?
a) ARM7
b) Pentium
c) SHARC
d) All of the mentioned

Answer: c
Explanation: SHARC supports harvard architecture for signal processing in DSP.

8. Why most of the DSPs use Harvard architecture?
a) they provide greater bandwidth
b) they provide more predictable bandwidth
c) they provide greater bandwidth & also more predictable bandwidth
d) none of the mentioned

Answer: c
Explanation: Most of the DSPs use harvard architecture because they provide a wider predictable bandwidth.

9. Which of the following supports CISC as well as Harvard architecture?
a) ARM7
b) ARM9
c) SHARC
d) None of the mentioned

Answer: c
Explanation: SHARC supports both the CISC and the Harvard architecture.

10. Which of the two architecture saves memory?
a) Harvard
b) Von Neumann
c) Harvard & Von Neumann
d) None of the mentioned

Answer: b
Explanation: As only one memory is present in the Von Neumann architecture so it saves a lot of memory.

This set of 8051 Micro-controller Multiple Choice Questions & Answers (MCQs) focuses on “Architecture”.

1. 8051 microcontrollers are manufactured by which of the following companies?
a) Atmel
b) Philips
c) Intel
d) All of the mentioned

Answer: d
Explanation: 8051 microcontrollers are manufactured by Intel, Atmel, Philips/Signetics, Infineon, Dallas Semi/Maxim.

2. AT89C2051 has RAM of:
a) 128 bytes
b) 256 bytes
c) 64 bytes
d) 512 bytes

Answer: a
Explanation: It has 128 bytes of RAM in it.

3. 8051 series has how many 16 bit registers?
a) 2
b) 3
c) 1
d) 0

Answer: a
Explanation: It has two 16 bit registers DPTR and PC.

4. When 8051 wakes up then 0x00 is loaded to which register?
a) PSW
b) SP
c) PC
d) None of the mentioned

Answer: c
Explanation: When 8051 wakes up, Program Counter (PC) loaded with 0000H. Because of this in 8051 first opcode is stored in ROM address at 0000H.

5. When the microcontroller executes some arithmetic operations, then the flag bits of which register are affected?
a) PSW
b) SP
c) DPTR
d) PC

Answer: a
Explanation: It stands for program status word. It consists of carry, auxiliary carry, overflow, parity, register bank select bits etc which are affected during such operations.

6. How are the status of the carry, auxiliary carry and parity flag affected if the write instruction
MOV A,#9C
ADD A,#64H
a) CY=0,AC=0,P=0
b) CY=1,AC=1,P=0
c) CY=0,AC=1,P=0
d) CY=1,AC=1,P=1

Answer: b
Explanation: On adding 9C and 64, a carry is generated from D3 and from the D7 bit so CY and AC are set to 1. In the result, the number of 1’s present are even so parity flag is set to zero.

7. How are the bits of the register PSW affected if we select Bank2 of 8051?
a) PSW.5=0 and PSW.4=1
b) PSW.2=0 and PSW.3=1
c) PSW.3=1 and PSW.4=1
d) PSW.3=0 and PSW.4=1

Answer: d
Explanation: Bits of PSW register are CY, AC, F0, RS1, RS0, OV, -, P so for selecting bank2 RS1=1 and RS0=0 which are fourth and third bit of the register respectively.

8. If we push data onto the stack then the stack pointer
a) increases with every push
b) decreases with every push
c) increases & decreases with every push
d) none of the mentioned

Answer: a
Explanation: If we push elements onto the stack then the stack pointer increases with every push of element.

9. On power up, the 8051 uses which RAM locations for register R0- R7
a) 00-2F
b) 00-07
c) 00-7F
d) 00-0F

Answer: b
Explanation: On power up register bank 0 is selected which has memory address from 00H-07H.

10. How many bytes of bit addressable memory is present in 8051 based microcontrollers?
a) 8 bytes
b) 32 bytes
c) 16 bytes
d) 128 bytes

Answer: c
Explanation: 8051 microcontrollers have 16 bytes of bit addressable memory.

This set of 8051 Micro-controller Multiple Choice Questions & Answers (MCQs) focuses on “LCD Interfacing”.

1. How many rows and columns are present in a 16*2 alphanumeric LCD?
a) rows=2, columns=32
b) rows=16, columns=2
c) rows=16, columns=16
d) rows=2, columns=16

Answer: d
Explanation: 16*2 alphanumeric LCD has 2 rows and 16 columns.

2. How many data lines are there in a 16*2 alphanumeric LCD?
a) 16
b) 8
c) 1
d) 0

Answer: b
Explanation: There are eight data lines from pin no 7 to pin no 14 in an LCD.

3. Which pin of the LCD is used for adjusting its contrast?
a) pin no 1
b) pin no 2
c) pin no 3
d) pin no 4

Answer: c
Explanation: Pin no 3 is used for controlling the contrast of the LCD.

4. For writing commands on an LCD, RS bit is
a) set
b) reset
c) set & reset
d) none of the mentioned

Answer: b
Explanation: For writing commands on an LCD, RS pin is reset.

5. Which command of an LCD is used to shift the entire display to the right?
a) 0x1C
b) 0x18
c) 0x05
d) 0x07

Answer: a
Explanation: 0x1C is used to shift the entire display to the right.

6. Which command is used to select the 2 lines and 5*7 matrix of an LCD?
a) 0x01
b) 0x06
c) 0x0e
d) 0x38

Answer: d
Explanation: 0x38 is used to select the 2 lines and 5*7 matrix of an LCD.

7. Which of the following step/s is/are correct for sending data to an LCD?
a) set the R/W bit
b) set the E bit
c) set the RS bit
d) all of the mentioned

Answer: d
Explanation: To send data to an LCD, RS pin should be set so that LCD will come to know that it will receive data which has to display on the screen. R/W pin should be reset as data has to be displayed (i.e. write to the LCD). High to low pulse must be applied to the E pin when data is supplied to data pins of the LCD.

8. Which of the following step/s is/are correct to perform reading operation from an LCD?
a) low to high pulse at E pin
b) R/W pin is set high
c) low to high pulse at E pin & R/W pin is set high
d) none of the mentioned

Answer: c
Explanation: For reading operations, R/W pin should be made high and added to it, a low to high pulse is also generated at the E pin.

9. Which instruction is used to select the first row first column of an LCD?
a) 0x08
b) 0x0c
c) 0x80
d) 0xc0

Answer: c
Explanation: 0x80 is used to select the first row first column of an LCD.

10. The RS pin is _________ for an LCD.
a) input
b) output
c) input & output
d) none of the mentioned

Answer: a
Explanation: The RS pin is an input pin for an LCD.

This set of AVR Micro-controller Multiple Choice Questions & Answers (MCQs) focuses on “Architecture”.

1. Is the following instruction correct LDI R3,50?
a) Yes
b) No
c) Cant be said
d) None of the mentioned

Answer: b
Explanation: If LDI Rd,k is written then the range of Rd varies from R16-R31, as R3 is less than R16 so this instruction will generate an error.

2. Registers R0-R31 are used for what type of works?
a) they are used for arithmetic and logic instructions
b) they are used for data copy
c) they are used for calculations
d) none of the mentioned

Answer: a
Explanation: GPRs are used for implementing arithmetic and logic instructions in the controller. They do the same work as the accumulator does in the other microcontrollers and microprocessors.

3. The largest value that can be loaded in an 8 bit register is?
a) 11111111H
b) FH
c) FFH
d) 00H

Answer: c
Explanation: The largest value that can be loaded in an 8 bit register is 11111111b or FFH.

4. The total space for the data memory available in the AVR based microcontroller is?
a) FFH
b) FFFH
c) FFFFH
d) FFFFFH

Answer: c
Explanation: The maximum value that can be loaded in the code memory of an AVR based microcontroller is FFFFH.

5. Which of the following instructions affect the flags of the status register?
a) AND
b) INC
c) OR
d) All of the mentioned

Answer: d
Explanation: AND, INC, OR could affect status register flags. All arithmetic and logical instructions affect status register flags except SER Rd instruction. SER Rd is used to SEt Register i.e. after the execution of this instruction Rd loaded with FFH value and no flag is affected.

6. What is the difference between the two given instructions?
LDI R16,0x34 and LDI R16,$34
a) One copies the hexadecimal value to R16 and the other copies the decimal value to the R16 register
b) One is for command, other is for data
c) One is for assignment, other is for operations
d) Both the commands are the same

Answer: d
Explanation: Both the above commands are the same. They both are used for assigning the hexadecimal values to the registers.

7. Which out of the following is not a directive?
a) .EQU
b) .DEVICE
c) .ORG
d) .LDI

Answer: d
Explanation: .EQU, .DEVICE, .ORG all are the directives to the assembler whereas LDI is a command.

8. Is an assembly language a high level language?
a) Yes
b) No
c) Can’t be said
d) None of the mentioned

Answer: b
Explanation: Assembly language is not high level language rather it is low level language because it deals directly with the internal structure of CPU. To program in assembly, the internal structure of the CPU must be known. Whereas in high level programming languages programmers don’t bother about the internal structure of the CPU because this is done by the compiler.

9. A 14-bit program counter can access __________ bytes of memory locations.
a) 4K
b) 8K
c) 16K
d) 64K

Answer: c
Explanation: A 14-bit program counter can access 214 bytes of memory locations i.e. 16k bytes.
Calculation:
214 = 24 x 210
= 16K (210 = 1024 or 1K).

10. When AVR wakes up, then the value of PC becomes?
a) 00H
b) 000H
c) 0000H
d) 00000H

Answer: d
Explanation: When an AVR wakes up, then the PC starts at the memory location 00000H.

This set of AVR Microcontroller Problems focuses on “Keyboard Interfacing”.

1. In reading the columns of a keyboard matrix, when no key is pressed then all the pins show?
a) 0
b) 1
c) F
d) 7

Answer: b
Explanation: When no key is pressed, in a keyboard then all the pins will read 1 as they all are connected to the main power supply.

2. To see if any key is pressed, all rows are grounded.
a) true
b) false
c) can’t be said
d) depends on the conditions

Answer: a
Explanation: To see that whether any key is pressed or not then all the rows are grounded so that columns can be read to deliver the better results.

3. Identify the row and the column for the following case when for the row D3-D0= 1110 and for the column D3-D0= 1101
a) first row and second column
b) first row and third column
c) second row and first column
d) second row and second column

Answer: a
Explanation: To identify the key that is pressed from this particular combination, we obtain that the key belongs to the first row and the second column as the D0 bit of the row port and the D1 bit of the column port are zero.

4. What are the actual steps that are followed in identifying any key that is being pressed?
a) wait for the debounce time
b) identify the key that is pressed
c) initially no key should be pressed
d) all of the mentioned

Answer: d
Explanation: In order to identify that which key is actually pressed form a particular format of a 3*3 matrix keyboard, we firstly ensure all initially all the keys are open, then we press a key and check that whether the key is actually pressed or not by waiting for a time span of 20mseconds, after this we identify the key that is pressed by masking the bits of the port. In this particular format, we can identify the key that is actually pressed.

5. To identify that the key is present in which row and the column
a) we ground the bits of the row one by one
b) we ground the bits of the column one by one
c) we connect the bits of the row to the logic level 1 one by one
d) we can connect the columns to the logic level 1 one by one

Answer: a
Explanation: To determine that the pressed key is in which row and column, we ground the rows one by one to determine the column by masking the bits separately.

6. The key detection and the key identification are two different procedures?
a) true
b) false
c) depends on the circumstances
d) difficult to tell

Answer: a
Explanation: The key detection and the key identification are the two different procedures, one is used to detect that whether any key is pressed or not and the other technique is used to find that the pressed key is located in which row and column.

7. What is described by the following command?
KCODE0<<1
a) load KCODE0 with 0
b) rotate the contents of the KCODE0 register to the right
c) rotate the contents of the KCODE0 register to the left
d) none of the mentioned

Answer: b
Explanation: KCODE0<<1 means to rotate the contents of the KCODE0 register to the left after every loop.

8. If the pins of the keyboard are used as an interrupt, then these pins will cause an interrupt of what type?
a) External hardware interrupt
b) Timer interrupt
c) TI/RI interrupt
d) None of the mentioned

Answer: a
Explanation: The pins of the keyboard act as an external hardware interrupt as some external pulse is helping in generating this interrupt.

9. What will happen if the two keys of the keyboard are pressed at a time?
a) both the keys will be displayed on the screen
b) the key which is being actually pressed(for more then 20microseconds) will be displayed
c) the key that is pressed first will be displayed
d) none of the mentioned

Answer: b
Explanation: If two or more keys are pressed at a time, then the key that will be pressed for more then 20 microseconds will be displayed on the screen.

10. Why initially all keys are considered open before detecting the key pressed?
a) to make the task easy
b) to remove the errors caused by other pressing keys during detection
c) to remove the flow problems
d) none of the mentioned

Answer: b
Explanation: Initially all keys are considered open in order to ensure the accuracy while identification of the pressed key.

This set of MSP430 Micro-controller Multiple Choice Questions & Answers (MCQs) focuses on “Architecture”.

1. In MSP430, the size of the status register is ________
a) 1 byte
b) 2 bytes
c) 1 bit
d) 2 bit

Answer: b
Explanation: In MSP430, the size of the status register is 2 bytes. The bits of the status register consists of the C flag, Z flag, N flag, GIE flag, CPU off, OSC off, SCG0, SCG1, V flag and 7 reserved bits.

2. Which of the following bit/s of the status register that allows the microcontroller to operate in its low power mode?
a) Z
b) Reserved
c) CPU off
d) N

Answer c
Explanation: The CPU off bit, OSC off bit, SCG0 bit, SCG1 bit of the status register are used to allow the microcontroller to operate in its low power mode.

3. What is actually done to improve the efficiency of a RISC processor?
a) instructions are reduced
b) they have two or more processors inbuilt connected between
c) they have many instructions that are interrelated to each other
d) they have one or more registers hard wired to the commonly used values

Answer: d
Explanation: To improve the efficiency of the RISC processor, the registers that are hard wired to commonly used values are used instead of other ones.

4. To improve the efficiency of an MSP430 based microcontroller, for one register
a) there is only one value for all addressing modes
b) there are two values for each addressing mode
c) there are 2 values for four addressing modes
d) there are 4 values for four addressing modes

Answer: d
Explanation: In MSP430, there are namely 4 addressing modes. So the main advantage of this controller( which basically increases its efficiency )is that for one register their exists 4 different values for 4 different addressing modes of the controller.

5. Their are_______________ number of emulated instructions found in the MSP430?
a) 4
b) 8
c) 16
d) 24

Answer: d
Explanation: The constants CG1 and CG2 are combined together to give 27 native instructions. These instructions are further converted into 24 emulated instructions. So, there are 24 emulated instructions found in an MSP430 based controller.

6. .w form is used for operations
a) that uses bytes
b) that uses words
c) that uses both
d) that uses none

Answer: c
Explanation: .w form is used for operations, that uses both bytes and words for operations.

7. Pre increment addressing is available in MSP430?
a) true
b) false
c) cant be said
d) depends on the conditions

Answer: b
Explanation: MSP430 supports only post increment addressing. For performing pre increment addressing, we require some special functions that accomplish that work.

8. Which out of the following is a correct emulated instruction?
a) ADC(.B) dst
b) ADD(.B) src,dst
c) ADDC(.B) src,dst
d) AND(.B) src,dst

Answer: a
Explanation: “ADC(.B) dst” this is emulated to “ADDC.B #0,dst” hence this is an emulated instruction. The emulated instructions use core instructions combined with the architecture and implementation of the CPU for higher code efficiency and faster execution.

9. dadd instruction can act as _____________
a) valid BCD addition
b) valid adder with carry
c) all of the mentioned
d) none of the mentioned

Answer: a
Explanation: Dadd instruction can act as a valid BCD addition instruction if the numbers are initially in BCD state(0-9).

10. Which of the following instructions don’t affect the status bits?
a) bis
b) bic
c) bis & bic
d) none of the mentioned

Answer: c
Explanation: bis and bic don’t affect the bits of the status register.

This set of MSP430 Microcontroller online quiz focuses on “TIMER_B”.

1. Why Timer_B is not considered as most suitable one for receiving asynchronous signals?
a) because of the absence of the TBOUTH input pin
b) because of the presence of the TBOUTH input pin
c) because of the absence of the SCCI bit
d) because of the presence of the SCCI bit

Answer: c
Explanation: The SCCI bit is absent in the Timer_B which means that the sampling mode is absent in it that’s why it is considered as unsuitable for receiving asynchronous signals.

2. There is double buffering in the immediate mode?
a) true
b) false
c) cant be said
d) depends on the conditions

Answer: b
Explanation: Immediate mode offers no double buffering condition. As here, values are copied to TBCLn as soon as they are written to TBCCRn.

3. Double buffering protects channel 0.
a) as it acts as the limit in the Up and up/down modes
b) it doesn’t actually protect it
c) as it does not accept the inputs
d) none of the mentioned

Answer: a
Explanation: Double buffering protects channel 0 as it acts as the limit in the Up and Up/Down modes.

4. Timer_B has _________
a) three serial communication ports
b) seven LCD driver
c) seven compare/capture channels
d) three LED driver ports

Answer: c
Explanation: Timer_B has seven compare/capture channels.

5. The capture/compare registers TBCCRn are double-buffered when used for compare events?
a) true
b) false
c) cant be said
d) depends on the conditions

Answer: a
Explanation: The capture/compare registers TBCCRn are double-buffered when used for compare events.

6. The length of TBR can be programmed to be _________
a) 8 bits
b) 12 bits
c) 16 bits
d) all of the mentioned

Answer: d
Explanation: The length of TBR can be programmed to be 8, 12, 16 or 10 bits long.

7. TBOUTH can pin can be used to _________
a) values are moved from one place to another
b) the length of the number of bits is selected by this register
c) it can be used to put all the outputs of the Timer_B register in the high impedance state
d) it can be used for outputting the input values of the timers

Answer: c
Explanation: TBOUTH pin is used to put all the outputs of the Timer_B register in the high impedance state by a high external signal applied to this pin.

8. TBCLn provided in each channel is actually _________
a) a comparator
b) compare latch
c) controller
d) control logic

Answer: b
Explanation: TBCLn is actually a compare latch that is provided in its every channel.

9. When TBR counts to zero?
a) TBCLn is updated from TBCCRn
b) CLLDx is updated to TBCCTLn
c) CLLDx is updated to TBCCRn
d) TBCLn is updated to CLLDx

Answer: a
Explanation: When TBR counts to zero, TBCLn is updated from TBCCRn.