Embedded Learning Notes 8——Matrix Keyboard of 51 Single Chip Microcomputer

Publisher:心想的45号Latest update time:2016-05-16 Source: eefocusKeywords:Embedded Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. The independent keyboard is driven by an I/O port of the microcontroller. If the developed system needs to use many keys, in order to save I/O ports, we generally use a 4*4 keyboard, so that only one 8-bit I/O port is needed to drive 16 keyboards.

Embedded Learning Notes 8——Matrix Keyboard of 51 Single Chip Microcomputer
 

2. Key detection (detecting which key is pressed):

    For the circuit in the figure above, first let P3 output 1111 0000, then start reading P3, according to the concept of line and, if one of P34~P37 is detected to be 0 (assuming P35 is 0), the column where the key is located can be determined; then conversely, P3 outputs 1101 1111 (the high bit keeps the value of the last detection), and also according to the concept of line and, if one of P30~P33 is detected to be 0 (assuming P30 is 0, then P3 is 1101 1110), the row where the key is located can be determined, thus determining the position of the pressed key. The entire detection time will definitely be less than the time it takes to press the key (about 20ms).

(Note: The concept of line AND - the high and low levels at both ends of the switch are ANDed, and the result is the level value of the entire line after the switch is closed)

Keywords:Embedded Reference address:Embedded Learning Notes 8——Matrix Keyboard of 51 Single Chip Microcomputer

Previous article:Embedded Learning Notes 1——Preparatory Knowledge of 51 MCU
Next article:Embedded Learning Notes 13——51 MCU D/A Converter

Recommended ReadingLatest update time:2024-11-16 15:38

CECEN will showcase its diverse embedded computing solutions at Embedded World 2022
June 15, 2022 - Rugged embedded computer brand – Cincoze, will make a grand debut at Embedded World 2022 in Germany from June 21 to June 23, 2022, with the theme of "All-round edge computing solutions for smart manufacturing". Three exhibition areas are planned on site, "Rugged Embedded Fanless Computers" edge comp
[Embedded]
CECEN will showcase its diverse embedded computing solutions at Embedded World 2022
Design of battery status detection and control software based on Qt/Embedded
1 Introduction The state parameter detection in the battery production process is the key to ensure the quality of the battery. However, at present, the state detection of domestic batteries mainly relies on instruments such as battery voltage patrol meter, battery conductivity tester and internal resistan
[Automotive Electronics]
Design of battery status detection and control software based on Qt/Embedded
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号