8051 Microcontroller Questions and Answers – Keyboard Interfacing

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

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.

2. What is described by this command: CJNE A,#00001111b, ROW1
a) it masks the bit and then jumps to the label where ROW1 is written
b) it makes the value of the accumulator 0FH and then jumps at the address where ROW1 label is written
c) it compares the value of the accumulator with 0FH and jumps to the location where ROW1 label is there if the value becomes equal
d) it compares the value of the accumulator with 0FH and jumps to the location where ROW1 label is there if the value is not equal
View Answer

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.

3. To detect that in which column, the key is placed?
a) we can mask the bits and then check it
b) we can rotate the bits and then check that particular bit which is set or reset(according to the particular condition)
c) none of the mentioned
d) all of the mentioned
View Answer

Answer: d
Explanation: We can mask or we can even rotate the bits to check that particularly in which column is the key placed.
advertisement
advertisement

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.

7. Key press detection and Key identification are:
a) the same processes
b) two different works are done in Keyboard Interfacing
c) none of the mentioned
d) any of the mentioned
View Answer

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.
advertisement

Sanfoundry Global Education & Learning Series – Microcontroller.

To practice all areas of Microcontroller, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.