250+ TOP MCQs on Serial Port Communication and Answers

8051 Micro-controller Multiple Choice Questions on ” Serial Port Communication”.

1. Which devices are specifically being used for converting serial to parallel and from parallel to serial respectively?
a) timers
b) counters
c) registers
d) serial communication

Answer: c
Clarification: Some registers like the parallel in serial out and serial in parallel out are used to convert serial data into parallel and vice versa respectively.

2. What is the difference between UART and USART communication?
a) they are the names of the same particular thing, just the difference of A and S is there in it
b) one uses asynchronous means of communication and the other uses synchronous means of communication
c) one uses asynchronous means of communication and the other uses asynchronous and synchronous means of communication
d) one uses angular means of the communication and the other uses linear means of communication

Answer: c
Clarification: UART stands for Universal Asynchronous receiver-transmitter and USART stands for Universal Synchronous and Asynchronous receiver-transmitter.

3. Which of the following best describes the use of framing in asynchronous means of communication?
a) it binds the data properly
b) it tells us about the start and stops of the data to be transmitted or received
c) it is used for error checking
d) it is used for flow control

Answer: b
Clarification: In data framing in asynchronous means of communication, the data is packed between the start and the stop bit. This is done so as to tell the other computer about the start and the end of the data.

4. Which of the following signal control the flow of data?
a) RTS
b) DTR
c) RTS & DTR
d) None of the mentioned

Answer: a
Clarification: RTS is a request to send control signal which is a control for the flow of data. On the other hand DTR is a Data Terminal Ready control signal which tells about the current status of the DTE.

5. Which of the following is the logic level understood by the micro-controller/micro-processor?
a) TTL logic level
b) RS232 logic level
c) None of the mentioned
d) TTL & RS232 logic level

Answer: a
Clarification: TTL logic or the transistor logic level is the logic that is understood by the micro-controllers/microprocessors.

6. What is a null modem connection?
a) no data transmission
b) no MAX232
c) the RxD of one is the TxD for the other
d) no serial communication

Answer: c
Clarification: In null modem connection the RxD of one is the TxD for the other.

7. Which of the following best states the reason that why baud rate is mentioned in serial communication?
a) to know about the no of bits being transmitted per second
b) to make the two devices compatible with each other, so that the transmission becomes easy and error free
c) to use Timer 1
d) for wasting memory

Answer: b
Clarification: To make two devices compatible with each other baud rate is mentioned in the serial communication so that the transmission becomes easy and error free.

8. With what frequency UART operates( where f denoted the crystal frequency )?
a) f/12
b) f/32
c) f/144
d) f/384

Answer: d
Clarification: UART frequency is the crystal frequency f/12 divided by 32, that comes out to be f/384.

9. What is the function of the SCON register?
a) to control SBUF and SMOD registers
b) to program the start bit, stop bit, and data bits of framing
c) to control SMOD registers
d) none of the mentioned

Answer: b
Clarification: SCON register is mainly used for programming the start bits, stop bits and data bits of framing. As it consists of bits like RB8, TB8, SM0, SM1, SM2 etc.

10. What should be done if we want to double the baud rate?
a) change a bit of the TMOD register
b) change a bit of the PCON register
c) change a bit of the SCON register
d) change a bit of the SBUF register

Answer: b
Clarification: PCON register consists of SMOD bit as its D7 bit, so if we set this bit then the baud rate gets doubled.

250+ TOP MCQs on LCD Interfacing and Answers

AVR Micro-controller Multiple Choice Questions on “LCD Interfacing”.

1. In AVR, the LCD operates in two main modes, it can be in 8 bit or 4 bit data.
a) true
b) false
c) depends on the situation
d) can’t be said

Answer: a
Clarification: In AVR, the LCD operates in two main modes, they are in the 8 bit data transfer mode and the 4 bit data transfer mode.

2. What can be the sequence of commands that may be used for initializing an LCD?
a) 0x06, 0x0e, 0x01
b) 0x0e, 0x01, 0x80
c) 0x38, 0x0e, 0x01
d) all of the mentioned

Answer: c
Clarification: For initializing an LCD, we can use commands like 0x38 for selecting the 5*7 matrix, 0x0e for display on and the cursor blinking and 0x01 for clearing the screen.

3. When the LCD operates in the 4 bit mode, then what more commands are added to it?
a) 33
b) 32
c) 28
d) all of the mentioned

Answer: d
Clarification: When an LCD operates in the 4 bit mode than 33, 32, 28 in hex are sent to it. They represent 3, 3, 3, 2 nibbles which tell the LCD to do into the 4 bit mode for saving the i/o pins of the port.

4. What is the main function of the LPM instruction used in LCD?
a) for initializing the LCD in the read mode
b) for initializing the LCD in the write mode
c) for sending a long string of characters to the LCD
d) all of the mentioned

Answer: c
Clarification: LPM instruction is used for sending a long string of characters to the LCD.

5. The RS pin acts as an
a) input pin
b) output pin
c) any of the mentioned depending on the conditions
d) none of the mentioned

Answer: a
Clarification: The RS pin of the LCD is used for selecting a particular register used for sending a command or the data to the LCD.

6. To latch in information at the data pins of the LCD, we send
a) H-L pulse at the E pin
b) L-H pulse at the E pin
c) A constant H pulse at the E pin
d) A constant L pulse at the E pin

Answer: a
Clarification: For latching in information at the data pins of the LCD, we send a H-L pulse at the LCD.

7. What is the function of the 0x06 command?
a) to clear the LCD
b) to blink the cursor
c) to shift the cursor to the right
d) for selecting the matrix

Answer: c
Clarification: 0x06 command is used for shifting the cursor to the right after every data send to it.

8. What is the address of the second column and the second row of the 2*20 LCD?
a) 0x80
b) 0x81
c) 0xc0
d) 0xc1

Answer: d
Clarification: 0xc0 acts as the address for selecting the second row and the first column of the LCD, so according to it if we need to select the second row and the second column of the LCD, then the address should be 0xc1.

9. Which of the following commands takes more than 100 microseconds to run?
a) shift cursor left
b) shift cursor right
c) set address location of the DDRAM
d) clear screen

Answer: d
Clarification: Clear screen is a command that takes more than 100 microseconds to run.

10. For selecting the data pins in an LCD, RS pin should be
a) 1
b) 0
c) F
d) 10

Answer: a
Clarification: For selecting the data pins of the LCD, the RS pin of the LCD should be set to 1.

250+ TOP MCQs on MSP430 Watchdog Timer and Answers

MSP430 Microcontroller Multiple Choice Questions on “Watchdog Timer”.

1. The watchdog counts up and resets the MSP430 when it reaches the limit?
a) true
b) false
c) cant be said
d) depends on the conditions

Answer: a
Clarification: The watchdog timer is used for the protection of the device. It keeps a track at the counter so that the code doesn’t reach an infinite unending loop. So it actually resets the counter before this particular condition.

2. Which of the following is correct about WDTCTL?
a) it is a 16 bit register
b) it is guided against accidental writes that require a password
c) a reset will occur if a value with an incorrect password is written to WDTCTL
d) all of the mentioned

Answer: d
Clarification: WDTCTL is a 16 bit register that is used for protecting the microcontroller. It actually resets the value when an incorrect password is written to WDTCTL.

3. WDTNMI is found in the _________
a) higher byte of WDTCTL
b) lower byte of WDTCTL
c) its first four bits
d) its last four bits

Answer: b
Clarification: WDTNMI is the fifth bit of the WDTCTL register.

4. Which of the following bits reads 0 under normal conditions but goes 1 when it wants to initiate some action?
a) WDTNMI
b) WDTHOLD
c) WDTTMSEL
d) WDTCNTCL

Answer: d
Clarification: WDTCNTCL is the bit that reads 0 under normal conditions but goes 1 when it wants to initiate some action like resetting the counter.

5. WDTISx bits control the _________
a) period of the clock
b) act as “Nonmaskable Interrupts”
c) stop the watchdog timer
d) start the watchdog timer

Answer: a
Clarification: WDTISx bits of the WDTCTL register is responsible for controlling the period of the clock.

6. The process of setting the WDTCNTCL bit in WDTCTL is through
a) petting
b) feeding
c) kicking
d) all of the mentioned

Answer: d
Clarification: the process of setting the WDTCNTCL bit in the WDTCTL register is by the processes like petting, feeding and kicking.

7. What is the function of this instruction “WDTCTL = WDTPW | WDTCONFIG”, where **#define WDTCONFIG (WDTCNTCL|WDTSSEL)**
a) it sets the watchdog timer
b) it configures and clears the watchdog timer
c) it stops the watchdog timer
d) it configures and sets the watchdog timer

Answer: b
Clarification: WDTCTL = WDTPW | WDTCONFIG instruction is used to clear and configure the watchdog timer of a microcontroller.

8. Is this instruction correct?
WDTCTL_bit.WDTCNTCL = 1;
a) yes
b) no
c) cant be said
d) depends on the conditions

Answer: b
Clarification: No WDTCTL_bit.WDTCNTCL = 1; is an incorrect way of setting the bits of the WDTCTL register because it violates the password protection.

9. Setting the WDTTMSEL bit of the WDTCTL register makes the watchdog timer act as
a) interrupt
b) communication device
c) converter
d) interval timer

Answer: d
Clarification: The WDTTMSEL bit of the WDTCTL register makes the watchdog timer act as the interval timer.

10. WDTIFG flag gets cleared if
a) if is interrupt had occurred
b) if the interrupt is serviced
c) if there can be no interrupt
d) all of the mentioned

Answer: b
Clarification: WDTIFG flag gets cleared if the interrupt is serviced so that again the interrupt can occur.

250+ TOP MCQs on Interrupt Programming and Answers

8051 Micro-controller Multiple Choice Questions on “Interrupt Programming”.

1. When an interrupt is enabled, then where does the pointer moves immediately after this interrupt has occurred?
a) to the next instruction which is to be executed
b) to the first instruction of ISR
c) to a fixed location in memory called interrupt vector table
d) to the end of the program

Answer: c
Clarification: When an interrupt occurs, then it jumps to a fixed memory location in memory called the interrupt vector table that holds the address of the Interrupt Service Routine.

2. What are the contents of the IE register, when the interrupt of the memory location 0x00 is caused?
a) 0xFFH
b) 0x00H
c) 0x10H
d) 0xF0H

Answer: b
Clarification: When interrupt of 0x00 is caused (the reset interrupt) then all the other interrupts will be disabled or the contents of the IE register becomes null.

3. After RETI instruction is executed then the pointer will move to which location in the program?
a) next interrupt of the interrupt vector table
b) immediate next instruction where interrupt is occurred
c) next instruction after the RETI in the memory
d) none of the mentioned

Answer: b
Clarification: When the RETI instruction is executed, PC will fetch 2-bytes (address) from top of stack which is stored when interrupt is occurred. This will return to the place where interrupt is occurred and starts executing instructions.

4. Which pin of the external hardware is said to exhibit INT0 interrupt?
a) pin no 10
b) pin no 11
c) pin no 12
d) pin no 13

Answer: c
Clarification: INT0 interrupt is caused when pin no 12 in the hardware of the 8051 controller is enabled with a low leveled pulse.

5. Which bit of the IE register is used to enable TxD/RxD interrupt?
a) IE.D5
b) IE.D2
c) IE.D3
d) IE.D4

Answer: d
Clarification: IE.D4 is used to enable RS interrupt or the serial communication interrupt.

6. Which of the following combination is the best to enable the external hardware interrupt 0 of the IE register (assuming initially all bits of the IE register are zero)?
a) EX0=1
b) EA=1
c) any of the mentioned
d) EX0=1 & EA=1

Answer: d
Clarification: For executing the EX0 interrupt, the EX0 and EA bits of the IE register should be set. EA is set to enable all the interrupts and EX0 is set to enable the external hardware interrupt 0 interrupt and mask the other enabled interrupts.

7. Why normally LJMP instructions are the topmost lines of the ISR?
a) so as to jump to some other location where there is a wider space of memory available to write the codes
b) so as to avoid overwriting of other interrupt instructions
c) all of the mentioned
d) none of the mentioned

Answer: c
Clarification: There is a small space of memory present in the vector table between two different interrupts so in order to avoid overwriting of other interrupts we normally jump to other locations where a wide range of space is available.

8. Which register is used to make the interrupt level or an edge triggered pulse?
a) TCON
b) IE
c) IPR
d) SCON

Answer: a
Clarification: TCON register is used to make any interrupt level or edge triggered.

9. What is the disadvantage of a level triggered pulse?
a) a constant pulse is to be maintained for a greater span of time
b) another interrupt may be generated if the low-level signal is not removed before the ISR is finished
c) it is difficult to produce
d) another interrupt may be caused if the signal is still low before the completion of the last instruction

Answer: d
Clarification: In a level triggered interrupt, if the low signal at interrupt pin must be removed before the execution of last instruction of the ISR i.e. RETI. If low signal at interrupt pin is not removed before completing the ISR then it will be generating another interrupt.

10. What is the correct order of priority that is set after a controller gets reset?
a) RI/TI > TF1 > TF0 > INT1 > INT0
b) RI/TI < TF1 < TF0 < INT1 < INT0
c) INT0 > TF0 > INT1 > TF1 > RI/TI
d) INT0 < TF0 < INT1 < TF1 < RI/TI

Answer: c
Clarification: On reset Interrupt Priorities are as INT0 > TF0 > INT1 > TF1 > RI/TI, where ‘>’ is used to denote highest priority.

250+ TOP MCQs on Keyboard Interfacing and Answers

AVR Microcontroller Problems 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: 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
Clarification: Initially all keys are considered open in order to ensure the accuracy while identification of the pressed key.

250+ TOP MCQs on MSP430 TIMER1 and Answers

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

1. Which of the following is true about the FRFQx bits of the BTCTL register?
a) these bits are used for clock input
b) these bits are used for setting a particular frequency fLCD
c) these bits start the timer
d) these bits stop the timer

Answer: b
Clarification: FRFQx bits of the BTCTL register are used for selecting a particular frequency fLCD varying from fACLK/256 to fACLK/32.

2. Timer1 is responsible for ________
a) providing a clock to the LCD module
b) cause an interrupt
c) a pulse for the RTC
d) all of the mentioned

Answer: d
Clarification: Timer1 is responsible for providing a clock for the LCD module. It can also cause an interrupt if the BTIE bit is high. It also provides the clock to the RTC.

3. For fACLK = 32 KHz, what would be the desirable range of fLCD?
a) 2hz-256hz
b) 12hz-512hz
c) 128hz-1khz
d) 1khz-10khz

Answer: c
Clarification: For fACLK = 32khz, the desirable range of the fLCD is the fACLK/256 to fACLK/32. This value comes out to be in the range of 128hz-1khz.

4. Normally BTCNT1 only function is to provide a prescalar for the BNTCNT2?
a) true
b) false
c) cant be said
d) depends on the conditions

Answer: a
Clarification: LCD’s controllers nowadays don’t require a clock pulse, so the only main function of the BTCNT1 is to provide a prescalar for the BNTCNT2.

5. BTCNT2 provides 2 output signals?
a) true
b) false
c) cant be said
d) depends on the conditions

Answer: b
Clarification: BNTCNT2 has no outputs. Instead, it raises the BTIFG flag at a frequency determined by the BTIPx bits.

6. RTCSEC, RTCMIN, RTCDOW etc. are the bytes of a set of registers that are used to store
a) seconds
b) minutes
c) days of a week
d) all of the mentioned

Answer: d
Clarification: The current time and date are held in a set of registers that contain the following bytes like RTCSEC, RTCMIN, RTCHOUR, RTCDOW etc.

7. The RTC module is configured in the calendar mode if __________
a) RTCMODE bit is reset
b) RTCMODE is set
c) RTCRDY is reset
d) RTCRDY is set

Answer:b
Clarification: Calendar mode is selected when RTCMODE is set.

8. The RTC module makes use of the Basic Timer1 because of _________
a) its bytes are controlled in the Basic Timer1 register
b) it is started by timer1
c) it is ended by basic timer1
d) it needs a clock pulse of 1hz that is provided by basic timer1

Answer: d
Clarification: The RTC module requires a clock of worth 1hz that is provided by basic timer1 so that why it makes use of basic timer1.

9. IF RTCIE interrupt is generated then _________
a) BTIFG flag is set
b) RTCFG flag is set
c) Both flags are set
d) None of the flag is set

Answer: c
Clarification: When RTCIE interrupt is generated then both BTIFG and RTCFG flags are set simultaneously.

10. What does the RTCTEVx bits do?
a) they cause an interrupt
b) they end an interrupt
c) they set the minute, hour, seconds daily at midnight or daily at noon
d) all of the mentioned

Answer: c
Clarification: Every minute, every hour, daily at midnight or daily at noon are set by the bits of the RTCTEVx bits of the RTCCTL register.