250+ TOP MCQs on Interfacing with Motors and Answers

8051 Micro-controller Multiple Choice Questions on “I/O Port Programming and Addressing Modes”.

1. What is the principle on which electromagnetic relays operate?
a) electromagnetic induction
b) motor control
c) switching
d) none of the mentioned

Answer: a
Clarification: Electromagnetic relays work on the principle of electromagnetic induction. It is used as a switch in industrial controls, automobile and appliances. It allows the isolation of the sections of a system with two different voltage sources.

2. What are DPDT relays?
a) Single pole, single throw
b) Single pole, double throw
c) Double pole, double throw
d) None of the mentioned

Answer: c
Clarification: In DPDT relay, there are two poles and two throws (i.e.contacts). For each pole there are two contacts i.e. normally open (NO) and normally closed (NC). The contacts can be NO or NC. Generally, contact is NC when the coil is not energized. When the coil is energized both poles become NC.

3. Why do we need a ULN2803 in driving a relay?
a) for switching a motor
b) for increasing the current
c) for increasing the power
d) for switching the voltage

Answer: b
Clarification: We need a ULN2803 for driving a relay because the relay coil requires 10mA or more current to be energized. If microcontroller pins are not able to provide sufficient current to drive relays then we need ULN2803 for driving relays.

4. Why are solid-state relays advantageous over electromechanical relays?
a) they need zero voltage circuit
b) they need less current to be energised
c) they need less voltage to be energised
d) none of the mentioned

Answer: b
Clarification: Solid-state relays are advantageous over electromechanical relays because their switching response time is much faster than electromechanical relays as solid-state relays are made-up of semiconductor materials. Also, solid-state relays required low input current for operation and small packaging make them ideal for microcontrollers.

5. What are optoisolators?
a) it is a driver
b) it is a thing isolated from the entire world
c) it is a device that can be used as an electromagnetic relay without a driver
d) none of the mentioned

Answer: c
Clarification: Optoisolators are devices that can be used as an electromagnetic relay without a driver. It usually consists of a led (transmitter) and a photoresistive receiver.

6. How can we control the speed of a stepper motor?
a) by controlling its switching rate
b) by controlling its torque
c) by controlling its wave drive 4 step sequence
d) cant be controlled

Answer: a
Clarification: Speed of a stepper motor can be controlled by changing its switching speed or by changing the length of the time delay loop.

7. Which of the following can be a unit for torque?
a) kg/m2
b) ounce-inch
c) kg-m3
d) g/m

Answer: b
Clarification: Torque is equal to the force applied at a particular distance. So its unit can be ounce-inch.

8. The RPM rating given for the DC motor is for?
a) no-loaded
b) loaded
c) none of the mentioned
d) all of the mentioned

Answer: a
Clarification: RPM rating given for a DC motor is for a no-loaded condition.

9. How can we change the speed of a DC motor using PWM?
a) By changing amplitude of PWM
b) By keeping fixed duty cycle
c) By changing duty cycle of PWM
d) By increasing power of PWM

Answer: c
Clarification: We can change the speed of a DC motor using PWM by changing the duty cycle of PWM. Changing duty cycle means changing ON and OFF timing of PWM. Even if amplitude of PWM is fixed by increasing the ON time of PWM increases the speed of the DC motor.

10. How can the direction of the DC motor be changed?
a) by changing the torque
b) by changing the switching speed
c) by changing the polarity of voltages connected to the leads
d) by changing the RPM rating

Answer: c
Clarification: The direction of the DC motor can be changed by changing the polarity of the voltages connected to its leads.

250+ TOP MCQs on AVR I2C Protocol and Answers

AVR Microcontroller test on “I2C Protocol”.

1. Which of the following is correct?
a) I2C is a technique by which data is transmitted with the help of only eight pins
b) SDA is used to synchronize data transfer between two chips
c) TWI is another name for I2C
d) All of the mentioned

Answer: c
Clarification: I2C is a technique by which data is transmitted between two devices by the help of only 2 pins so it is also called Two wire Serial Interface.

2. Which of the following is true about the I2C protocols?
a) the data line cannot change when the clock line is high
b) the data line can change when the clock line is high
c) the clock line cannot change when the data line is high
d) the clock line can change when the data line is high

Answer: a
Clarification: According to I2C protocols, the data line(SDA) changes only if the clock line(SCL) is at its active low level.

3. I2C is a connection oriented communication protocol.
a) true
b) false
c) cant be said
d) depends on the conditions

Answer: a
Clarification: I2C is a connection oriented protocol i.e each transmission is initiated by a START condition and is terminated by a STOP condition.

4. The STOP condition is generated by a
a) high to low change in the SDA line when the SCL is low
b) high to low change in the SDA line when the SCL is high
c) low to high change in the SDA line when the SCL is low
d) low to high change in the SDA line when the SCL is high

Answer: c
Clarification: The STOP condition is generated when there is a low to high change in the SDA line when the SCL is low.

5. For receiving the acknowledgment
a) SDA from the transmitter should be high
b) SDA from the transmitter should be low
c) SDA from receiver should be high
d) SDA from receiver should be low

Answer: d
Clarification: The packet format in I2C consists of 9 bits, out of which first 8 are the data bits while the ninth bit is the acknowledgment bit. For obtaining the acknowledgment, the SDA line of the receiver should be pushed to low.

6. What steps are followed to complete the data transfer?
a) START condition, STOP condition
b) Address packet
c) One or more data packet
d) All of the mentioned

Answer: d
Clarification: For having the complete data transfer, the steps that are actually being followed are START condition, address packet, one or more data packet, STOP condition.

7. I2C is ideal for short distances?
a) true
b) false
c) cant be said
d) depends on the conditions

Answer: a
Clarification: I2C is that module of the AVR, which is used for short distances.

8. Which of the following is a register used for programming AVR’s I2C module?
a) TWBR
b) TWCR
c) TWSR
d) All of the mentioned

Answer: d
Clarification: TWBR( TWI Bit rate register), TWCR( TWI Control Register), TWSR(TWI Status Register), TWAR(TWI Address Register), TWDR( TWI Data Register) are used for programming an AVR’s I2C module.

9. Which bit is polled to know that whether the TWI is ready or not?
a) TWWC
b) TWINT
c) TWEA
d) All of the mentioned

Answer: b
Clarification: TWINT is the bit that is polled to know that whether the TWI is ready or not.

10. Is status flag important in multi master systems?
a) yes
b) no
c) depends on the conditions
d) cant be said

Answer:a
Clarification: Yes, the status flag plays a very vital role in multi master systems.

250+ TOP MCQs on MSP430 Communication and Answers

MSP430 Micro-controller Multiple Choice Questions on “Communication”.

1. What actually is a bit bagging?
a) it actually refers to the technique of assigning the bits with their inputs
b) a technique by which an MSP430 can communicate through hardware
c) a technique by which MSP430 can communicate through software
d) a technique through which conversion becomes possible

Answer: c
Clarification: Bit bagging is the technique through which a processor can communicate to its associate partners when an appropriate hardware is not available for its purpose. This communication is made possible through the software.

2. SPI, I2C, Asynchronous serial communication are the means of communicating a processor with its associate partners?
a) true
b) false
c) cant be said
d) depends on the conditions

Answer: a
Clarification: SPI, I2C, Asynchronous serial communication are the means for the processor by which communication is made possible.

3. All digital communications don’t require any clock.
a) true
b) false
c) cant be said
d) depends on the conditions

Answer: b
Clarification: Clock is the prior need for any communication to occur. This is because synchronization is maintained with the help of a clock.

4. SPI needs______ wires than I2C?
a) less
b) same
c) more
d) depends on the conditions

Answer: c
Clarification: In SPI, there is no control of transmission in software—no addresses or acknowledgment, that’s why it requires more amount of wires.

5. USI handles _________
a) SPI
b) I2C
c) SPI & I2C
d) None of the mentioned

Answer: c
Clarification: USI(Universal Serial Interface) supports both the types of synchronous communication i.e. SPI and I2C.

6. USCI consists of _________
a) one channel
b) two channels
c) three channels
d) four channels

Answer: b
Clarification: USCI consists of mainly two channels, A and B. These are largely independent but share a few registers and interrupt vectors.

7. LIN is enabled in which of the following channels?
a) A
b) B
c) C
d) D

Answer: a
Clarification: Channel A is the asynchronous receiver/ transmitter channel. It can detect the baud rate of an incoming signal, which enables its use on a local interconnect network (LIN).

8. Can one device have more than one USC interfaces?
a) yes
b) no
c) depends on the conditions
d) cant be said

Answer: a
Clarification: Yes, one device can have more than one USC interfaces. There is a small difference because the interrupt flags and enable bits for the “0” modules are in a special function registers IFG2 and IE2, while those for the “1” modules are in their own registers, UC1IFG and UC1IE.

9. Which of the following conditions is more difficult to attain?
a) synchronous masters
b) synchronous slaves
c) asynchronous masters
d) asynchronous slaves

Answer: d
Clarification: Synchronous slaves are the most difficult to attain because the problem is that the slave must react quickly when a clock transition arrives from the master.

10. Timer_A is used in _________
a) SPI
b) I2C
c) Asynchronous Serial Communication
d) All of the mentioned

Answer: c
Clarification: Timer_A is used in the Asynchronous Serial Communication.

250+ TOP MCQs on Introduction to Microcontroller and Answers

Micro-controller Multiple Choice Questions on “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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: Microcontrollers are designed to perform dedicated tasks. While designing general purpose computers end use is not known to designers.

250+ TOP MCQs on Architecture and Answers | Advanced Virtual RISC

AVR Micro-controller Multiple Choice Questions 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: .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
Clarification: 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
Clarification: 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
Clarification: When an AVR wakes up, then the PC starts at the memory location 00000H.

250+ TOP MCQs on MSP430 Architecture and Answers

MSP430 Micro-controller Multiple Choice Questions 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: .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
Clarification: 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
Clarification: “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
Clarification: 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
Clarification: bis and bic don’t affect the bits of the status register.