Department of Electronics and Communication 8051 Microcontroller and Interfacing Objective Questions and Answers Iii Year Unit - I
Department of Electronics and Communication 8051 Microcontroller and Interfacing Objective Questions and Answers Iii Year Unit - I
UNIT – I
B
64 bytes
.
C
128 bytes
.
D
256 bytes
.
Answer: Option C
B
2
.
C
3
.
D
4
.
Answer: Option B
A
2
.
B
3
.
C
4
.
D
5
.
Answer: Option C
4.The total external data memory that can be interfaced to the 8051 is:
A
32K
.
B
64K
.
C
128K
.
D
256K
.
Answer: Option B
5.The total amount of external code memory that can be interfaced to the 8051 is:
A
32K
.
B
64K
.
C
128K
.
D
256K
.
Answer: Option B
6.The I/O port that does not have a dual-purpose role is:
A
port 0
.
B
port 1
.
C
port 2
.
D
port 3
.
Answer: Option B
B
serial port output
.
C
memory write strobe
.
D
memory read strobe
.
Answer: Option A
Answer: d
Explanation: 16*2 alphanumeric LCD has 2 rows and 16 columns.
Answer: b
Explanation: There are eight data lines from pin no 7 to pin no 14 in an LCD.
Answer: c
Explanation: Pin no 3 is used for controlling the contrast of the LCD.
5. Which command of an LCD is used to shift the entire display to the right?
a) 0x1C
b) 0x18
c) 0x05
d) 0x07
View Answer
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
View Answer
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
View Answer
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
View Answer
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
View Answer
Answer: c
Explanation: 0x80 is used to select the first row first column of an LCD.
Answer: a
Explanation: The RS pin is an input pin for an LCD.
1. Which of the following steps detects the key in a 4*4 keyboard matrix about the key that is being
pressed?
a) masking of bits
b) ensuring that initially, all keys are open
c) checking that whether the key is actually pressed or not
d) all of the mentioned
View Answer
Answer: d
Explanation: For detecting that whether the key is actually pressed or not, firstly this must be ensured
that initially all the keys are closed. Then we need to mask the bits individually to detect that which key
is pressed. Then we need to check that is the key actually pressed or not, by checking that whether the
key pressed for a time more than 20 micro seconds.
Answer: d
Explanation: This particular command CJNE A,#00001111b, ROW1 compares the value of the
accumulator with OFH and jumps to ROW1 address if the value is not equal.
Answer: d
Explanation: We can mask or we can even rotate the bits to check that particularly in which column is
the key placed.
4. In reading the columns of a matrix, if no key is pressed we should get all in binary notation
a) 0
b) 1
c) F
d) 7
View Answer
Answer: b
Explanation: If no key is pressed, then all the keys show 1 as they are all connected to power supply.
5. If we need to operate a key of a keyboard in an interrupt mode, then it will generate what kind of
interrupt?
a) ES
b) EX0/EX1
c) T0/T1
d) RESET
View Answer
Answer: b
Explanation: If a key is to operate in an interrupt mode then it will generate an external hardware
interrupt.
6. To identify that which key is being pressed, we need to:
a) ground all the pins of the port at a time
b) ground pins of the port one at a time
c) connect all the pins of the port to the main supply at a time
d) none of the mentioned
View Answer
Answer: b
Explanation: To detect that which key is being pressed, we need to ground the pins one by one.
Answer: b
Explanation: They are two different works that are involved in Keyboard Interfacing. One is used for
checking that which key is being actually pressed and the other is used to check that is the key actually
pressed or not.
Answer: d
Explanation: Two grounds are available in ADC0804 to isolate analog signal from digital signal. This
isolation provides accuracy in digital output.
Answer: c
Explanation: WR is active low input used to inform the ADC0804 to start the conversion process.
3. State which of the following statements are false?
a) CLK IN pin used for External Clock Input or Internal Clock with external RC element
b) INTR pin tells about the end of the conversion
c) ADC0804 IC is an 8 bit parallel ADC in the family of the ADC0800 series
d) None of the mentioned
View Answer
Answer: d
Explanation: CLK IN pin is used to tell about the conversion time, INTR pin tells about the end of the
conversion and ADC0804 has a resolution of 8 bits only so all three statements are true.
Answer: b
Explanation: While programming the ADC0808/0809 IC firstly we need to select the channel from the A,
B, C pins. Then we need to activate the ALE signal, this is needed to latch the address. Then we start the
conversion from the WR pin. After monitoring the INTR pin we get to know about the end of the
conversion. Then we activate the OE enable to read out data out of the ADC chip.
Answer: a
Explanation: Step Size is calculated by formula Vref/(2 n). As ADC0808/0809 8-bit ADC value of n=8.
Therefore formula becomes Vref/(2 8) = Vref/256. If Vref = 5V then Step Size will be 5/256 i.e. 19.53mV.
Answer: a
Explanation: DAC0804 is used for parallel data to analog data conversion.
Answer: d
Explanation: For n input DAC has 2^n discrete voltage levels.
Answer: c
Explanation: INTR pin tells about the end of the conversion (output) and WR pin tells us to start the
conversion (input).
Answer: b
Explanation: SCLK is used to bring data out and send in the control byte.
The 8255 is a ______ chip.
a) Input/Output
b) Analog to Digital
c) Digital to analog
d) None of the mentioned
View Answer
Answer: a
Explanation: The 8255 is Input/Output (I/O) chip. It has three separate accessible ports. The 8255 chip is
used to expand the I/O ports of microcontrollers.
Answer: d
Explanation: RD, WR, D0-D7 all are directly connected to the 8051 for telling the chip about the control
signals and also for transferring the data.
3. Find the control word for PA = out, PB = in, PCL = out, PCH = out (Mode0)?
a) 0x02H
b) 0x82H
c) 0x83H
d) 0x03H
View Answer
Answer: b
Explanation: The value that is being loaded in the control word is 10000010b for PB as an input port and
all others as the output ports being operated in mode0. The hex equivalent of 10000010b → 0x82H.
4. Which pins are used to select the ports and the control register?
a) CS
b) A1
c) A0
d) All of the mentioned
View Answer
Answer: d
Explanation: CS pin is an active low input pin for 8255 and it is used for selecting a chip. A0 and A1 pins
are used for select ports and the control register.
5. What is the value of the control register when RESET button is set to zero?
a) 0x00H
b) 0xFFH
c) 0x11H
d) value remains the same
View Answer
Answer: d
Explanation: RESET is active-high signal input into the 8255 used to clear the control register. When
RESET is activated (i.e. set to high), all ports are initialized as input mode. Hence the value of the control
register remains the same as it is even when the RESET button is set to zero.
6. Why MOVX instruction is being used to access the ports of the 8255?
a) because 8255 is connecting a microcontroller in memory mapped I/O configuration
b) because 8255 is used to access the external communication
c) because 8255 is used to access the data transfer
d) because 8255 is used to access the interfacing of LCD, motor etc
View Answer
Answer: a
Explanation: As 8255 is connecting a microcontroller in memory mapped I/O configuration. This means
that memory space used to access 8255 (i.e. 8255 is treated as external memory). MOVX instruction is
used to access external memory locations.
Answer: c
Explanation: BSR (Bit Set/Rest) mode is used to program individual bits of PORT C only.
8. How many pins of the 8255 can be used as the I/O ports?
a) 8
b) 16
c) 24
d) 32
View Answer
Answer: c
Explanation: There are 3 ports available in the 8255 so 24 pins are available for the I/O ports pins.
Answer: a
Explanation: 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.
Answer: c
Explanation: 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.
Answer: b
Explanation: 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.
Answer: b
Explanation: 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.
Answer: c
Explanation: 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.
Answer: a
Explanation: Speed of a stepper motor can be controlled by changing its switching speed or by changing
the length of the time delay loop.
Answer: b
Explanation: Torque is equal to the force applied at a particular distance. So its unit can be ounce-inch.
Answer: a
Explanation: RPM rating given for a DC motor is for a no-loaded condition.
Answer: c
Explanation: 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.
Answer: c
Explanation: The direction of the DC motor can be changed by changing the polarity of the voltages
connected to its leads.