8.1
This presentation is the property of its rightful owner.
Sponsored Links
1 / 34

8.1 键盘接口技术 PowerPoint PPT Presentation


  • 74 Views
  • Uploaded on
  • Presentation posted in: General

8.1 键盘接口技术. 8.1.1 行列式非编码键盘的工作原理 行列式键盘又叫矩阵键盘,如图 8-1 所示,按键设置在行列的交叉点上,如用 2×2 的行列结构可构成四个键的键盘, 4×4 的行列结构可构成 16 个键的键盘。在按键数量较多时,矩阵键盘可节省 I/O 口线。. 图 8-1 矩阵键盘与 AT89C51 接口连接图. 图 8-2 键闭合及断开时的电压抖动. 综上所述,对于非编码键盘,按键处理程序应具有如下四个功能: (1) 判断键盘上有无键按下。 (2) 去除键的机械抖动。 (3) 求按下键的键码。

Download Presentation

8.1 键盘接口技术

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


8 1

8.1

  • 8.1.1

  • 8-1224416I/O


8 1

8-1 AT89C51


8 1

8-2


8 1

  • (1)

  • (2)

  • (3)

  • (4)

  • 8.1.2

  • 1.

  • CPU


8 1

  • [8.1] 8-1RAM 32H

  • P1.4P1.7P1.0P1.3+5 V

  • (1) 0P1RAM 30H


8 1

  • (2) 0P1RAM 31H

  • (3) 30H431H4A

  • (4) AA1A(AJNZ)10111110B


8 1

  • :

  • BOADLCALL BOADD

  • JNZ BOAD1 BOAD

  • LCALL DELAY

  • AJMP BOAD

  • BOAD1LCALL DELAY ()

  • LCALL BOADD

  • JNZ BOAD2

  • LCALL DELAY

  • SJMP BOAD


8 1

  • BOAD2CPL A

  • MOV 32HA

  • BOAD3LCALL DELAY

  • LCALL BOADD

  • JNZ BOAD3

  • B2RET


8 1

  • BOADDMOV P1#0FH 0

  • MOV AP1

  • MOV 30HA

  • MOV P1#0F0H 0

  • MOV AP1

  • MOV 31HA

  • ANL 30H#0FH


8 1

  • MOV A30H

  • ANL 31H#0F0H

  • ADD A31H

  • CPL A A0

  • RET


8 1

  • 2.

  • CPU

  • 3.

  • CPU

  • 8-3AT89C5128


8 1

8-3 28


8 1

  • 8-4(INT1INT0)


8 1

  • ORG 0000H

  • LJMP BEGIN

  • ORG 0003H

  • LJMP WZD0 0

  • ORG 0013H

  • LJMP WZD1 1


8 1

  • BEGINORG 0100H

  • MOV SP#60H

  • MOV R1#00H R1

  • SETB IT1 INT0INT1

  • SETB IT0

  • SETB EA

  • SETB EX0

  • SETB EX1

  • MOV P1#00H


8 1

  • ()

  • ()

  • WZD0PUSH PSW

  • PUSH A

  • CLR EX0 INT0

  • LCALL DELAY

  • JNB P3.2WZD01

  • INT0


8 1

  • SETB EX0

  • POP A

  • POP PSW

  • RETI

  • WZD01MOV A#01H S11

  • MOV P1#0FEH P1.0

  • JNB P3.2KEYR1 S1


8 1

  • INC A S11

  • MOV P1#0FDH P1.1P1.0

  • JNB P3.2KEYR1

  • INC A

  • MOV P1#0FBH

  • JNB P3.2KEYR1

  • INC A

  • MOV P1#0F7H

  • JNB P3.2KEYR1

  • INC A


8 1

  • MOV P1#0EFH

  • JNB P3.2KEYR1

  • INC A

  • MOV P1#0DFH

  • JNB P3.2KEYR1

  • INC A

  • MOV P1#0BFH

  • JNB P3.2KEYR1

  • INC A

  • MOV P1#7FH


8 1

  • JNB P3.2KEYR1

  • LJMP KEYR2

  • KEYR1MOV R1A R1

  • KEYR2CLR IE0 (IE0)

  • SETB EX0 INT0

  • POP A

  • POP PSW

  • RETI

  • WZD110()

  • DELAY()


8 1

8-4

(a) (b) INT0


8 2 led

8.2 LED

  • 8.2.1 LED

  • LED8-5LED8-5(a)LED8-5(b)LEDLEDLEDDPLED


8 1

8-5 LED

(a) (b) (c)


8 1

3F

06

5B

4F

66

6D

7D

07

7F

6F

0

1

2

3

4

5

6

7

8

9

  • 8-1 LED

8-6


8 1

  • 8.2.2 LED

  • 1

  • +5 V(adp)88-74


8 1

8-7 4LED


8 1

  • 2.

  • I/Oabcdefgsp8I/OI/OLED8-88LED.


8 1

8-8 8LED


8 1

  • [8.2] 8-9RAM 50H57H

8-9 AT89C51LED


8 1

  • 8-98255A8LEDAB8255AAFFFCHBFFFDHFFFFHAB80HRAM 50H57H


8 1

  • DIRMOV A#10000000B

  • 8255AB

  • MOV DPTR#0FFFFH

  • 8255DPTR

  • MOVX @DPTRA

  • MOV R0#50H 50H57H

  • MOV R3#7FH

  • MOV AR3


8 1

  • SCANMOV DPTR#0FFFDH B

  • MOVX @DPTRA B

  • MOV [email protected]

  • MOV DPTR#TAB

  • MOVC [email protected]+DPTR

  • MOV DPTR#0FFFCH A


8 1

  • MOVX @DPTRA A

  • ACALL DL1ms 1 ms

  • INC R0

  • MOV AR3

  • JNB ACC.0ED 8

  • RR A

  • MOV R3A

  • AJMP SCAN


8 1

  • EDRET

  • TABDB3FH06H5BH4FH66H

  • 0F

  • DB 6DH7DH07H7FH6FH

  • DL1msMOV R7#01H 1 ms

  • DL0MOV R6#0FFH

  • DL1DJNZ R6DLI

  • DJNZ R7DLO

  • RET


  • Login