⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 +

📁 键盘接口与编程.包含1.矩阵式键盘的结构与工作原理.2.矩阵式键盘的按键识别方法 及源程序.
💻
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0037)http://www.51c51.com/jxue/dpjjx28.htm -->
<HTML xmlns:v = "urn:schemas-microsoft-com:vml" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word"><HEAD><TITLE>键盘接口与编程</TITLE><LINK 
href="键盘接口与编程.files/gpszx.css" type=text/css rel=stylesheet><LINK 
href="键盘接口与编程.files/gpszx.css" type=text/css rel=stylesheet>
<META http-equiv=Content-Type content="text/html; charset=GB2312">
<META content=Word.Document name=ProgId>
<META content="MSHTML 6.00.2900.2627" name=GENERATOR>
<META content="Microsoft Word 9" name=Originator><LINK 
href="./dpjjx28.files/filelist.xml" rel=File-List><LINK 
href="./dpjjx28.files/editdata.mso" rel=Edit-Time-Data><!--[if !mso]>
<STYLE>v\:* {
	BEHAVIOR: url(#default#VML)
}
o\:* {
	BEHAVIOR: url(#default#VML)
}
w\:* {
	BEHAVIOR: url(#default#VML)
}
.shape {
	BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
<w:Compatibility>
<w:UseFELayout/>
</w:Compatibility>
</w:WordDocument>
</xml><![endif]-->
<STYLE>@font-face {
	font-family: 宋体;
}
@font-face {
	font-family: 黑体;
}
@font-face {
	font-family: @宋体;
}
@font-face {
	font-family: @黑体;
}
@page  {mso-page-border-surround-header: no; mso-page-border-surround-footer: no; }
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin: 42.55pt; mso-footer-margin: 49.6pt; mso-paper-source: 0; }
P.MsoNormal {
	TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-style-parent: ""; mso-pagination: none
}
LI.MsoNormal {
	TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-style-parent: ""; mso-pagination: none
}
DIV.MsoNormal {
	TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-style-parent: ""; mso-pagination: none
}
H1 {
	FONT-WEIGHT: bold; TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 22pt; MARGIN: 17pt 0cm 16.5pt; LINE-HEIGHT: 240%; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-font-kerning: 22.0pt; mso-pagination: lines-together; mso-style-next: 正文; mso-outline-level: 1
}
H2 {
	FONT-WEIGHT: bold; TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 16pt; MARGIN: 13pt 0cm; LINE-HEIGHT: 172%; FONT-FAMILY: Arial; TEXT-ALIGN: justify; mso-fareast-font-family: 黑体; mso-font-kerning: 1.0pt; mso-pagination: lines-together; mso-style-next: 正文; mso-outline-level: 2; mso-bidi-font-family: "Times New Roman"
}
H3 {
	FONT-WEIGHT: bold; TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 16pt; MARGIN: 13pt 0cm; LINE-HEIGHT: 172%; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-font-kerning: 1.0pt; mso-pagination: lines-together; mso-style-next: 正文; mso-outline-level: 3
}
H4 {
	FONT-WEIGHT: bold; TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 14pt; MARGIN: 14pt 0cm 14.5pt; LINE-HEIGHT: 155%; FONT-FAMILY: Arial; TEXT-ALIGN: justify; mso-fareast-font-family: 黑体; mso-font-kerning: 1.0pt; mso-pagination: lines-together; mso-style-next: 正文; mso-outline-level: 4; mso-bidi-font-family: "Times New Roman"
}
H5 {
	FONT-WEIGHT: bold; TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 14pt; MARGIN: 14pt 0cm 14.5pt; LINE-HEIGHT: 155%; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-font-kerning: 1.0pt; mso-pagination: lines-together; mso-style-next: 正文; mso-outline-level: 5
}
H6 {
	FONT-WEIGHT: bold; TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 12pt 0cm 3.2pt; LINE-HEIGHT: 132%; FONT-FAMILY: Arial; TEXT-ALIGN: justify; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 黑体; mso-font-kerning: 1.0pt; mso-pagination: lines-together; mso-style-next: 正文; mso-outline-level: 6; mso-bidi-font-family: "Times New Roman"
}
A:link {
	COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlink {
	COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
A:visited {
	COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlinkFollowed {
	COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
P {
	TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 0cm; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-pagination: none; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
DIV.Section1 {
	page: Section1
}
OL {
	MARGIN-BOTTOM: 0cm
}
UL {
	MARGIN-BOTTOM: 0cm
}
</STYLE>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1027"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1"/>
</o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=ZH-CN style="tab-interval: 21.0pt" vLink=purple link=blue>
<DIV class=Section1>
<P 
style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; TEXT-ALIGN: center; mso-list: l2 level1 lfo2; tab-stops: list 36.0pt" 
align=center><![if !supportLists]><SPAN lang=EN-US 
style="FONT-SIZE: 16pt; COLOR: red; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 黑体; mso-font-kerning: 0pt">1.<SPAN 
style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; 
</SPAN></SPAN><![endif]><SPAN 
style="FONT-SIZE: 16pt; COLOR: red; FONT-FAMILY: 黑体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: 'Times New Roman'">矩阵式键盘接口技术及编程</SPAN><SPAN 
lang=EN-US 
style="FONT-SIZE: 16pt; COLOR: red; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 黑体; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P 
style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo4; tab-stops: list 36.0pt"><![if !supportLists]><SPAN 
lang=EN-US>1.<SPAN 
style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN></SPAN><![endif]><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">矩阵式键盘的结构与工作原理:</SPAN></P>
<P style="MARGIN-LEFT: 36pt"><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在键盘中按键数量较多时,为了减少</SPAN><SPAN 
lang=EN-US>I/O</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">口的占用,通常将按键排列成矩阵形式,如图</SPAN><SPAN 
lang=EN-US>1</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所示。在矩阵式键盘中,每条水平线和垂直线在交叉处不直接连通,而是通过一个按键加以连接。这样,一个端口(如</SPAN><SPAN 
lang=EN-US>P1</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">口)就可以构成</SPAN><SPAN 
lang=EN-US>4*4=16</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个按键,比之直接将端口线用于键盘多出了一倍,而且线数越多,区别越明显,比如再多加一条线就可以构成</SPAN><SPAN 
lang=EN-US>20</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">键的键盘,而直接用端口线则只能多出一键(</SPAN><SPAN 
lang=EN-US>9</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">键)。由此可见,在</SPAN></P>
<TABLE 
style="MARGIN-LEFT: 36pt; WIDTH: 225pt; mso-cellspacing: 1.5pt; mso-padding-alt: 1.5pt 1.5pt 1.5pt 1.5pt" 
cellPadding=0 width=300 border=0>
  <TBODY>
  <TR>
    <TD 
    style="PADDING-RIGHT: 1.5pt; PADDING-LEFT: 1.5pt; PADDING-BOTTOM: 1.5pt; PADDING-TOP: 1.5pt">
      <P class=MsoNormal><SPAN lang=EN-US><IMG id=_x0000_i1025 height=333 
      src="键盘接口与编程.files/dpj281.gif" width=308></SPAN><SPAN lang=EN-US 
      style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体"><o:p></o:p></SPAN></P></TD></TR></TBODY></TABLE>
<P style="MARGIN-LEFT: 36pt"><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">需要的键数比较多时,采用矩阵法来做键盘是合理的。</SPAN></P>
<P style="MARGIN-LEFT: 36pt"><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">矩阵式结构的键盘显然比直接法要复杂一些,识别也要复杂一些,上图中,列线通过电阻接正电源,并将行线所接的单片机的</SPAN><SPAN 
lang=EN-US>I/O</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">口作为输出端,而列线所接的</SPAN><SPAN 
lang=EN-US>I/O</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">口则作为输入。这样,当按键没有按下时,所有的输出端都是高电平,代表无键按下。行线输出是低电平,一旦有键按下,则输入线就会被拉低,这样,通过读入输入线的状态就可得知是否有键按下了。具体的识别及编程方法如下所述。</SPAN></P>
<P 
style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo4; tab-stops: list 36.0pt"><![if !supportLists]><SPAN 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -