3×4 matrix keyboard circuit diagram and assembly language source program

Publisher:心语如画Latest update time:2011-07-31 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The 3×4 matrix keyboard is connected to the microcomputer through the parallel interface chip 8255A. Port A of 8255A is defined as the output port, connected to the keyboard row line; port B is defined as the input port, connected to the keyboard column line. Assume that the address of port A of 8255A is 40H, the address of port B is 41H, and the address of the control register is 43H.

MOV  AL,82H
OUT  43H,AL
BEGIN:MOV  AL,0
OUT  40H,AL
WAIT :    IN    AL,41H
AND  AL,0FH
CMP  AL,0FH
JZ    WAIT
MOV  CX,7FFH
L0: LOOP  L0
ST: MOV   BL,3
MOV  BH,4
MOV  AL,0FEH
MOV  CL,0FH
MOV  CH,0FFH
L1: OUT  40H,AL
ROL   AL
MOV  AH,AL
IN     AL,41H
AND   AL,CL
CMP   AL,CL
JNZ    L2
ADD  CH,BH
MOV  AL,AH
DEC   BL
JNZ   L1
JMP   BEGIN
L2:  INC   CH
RCR   AL
JC     L2
MOV  AL,CH
JMP   KEYTABLE

Figure 12-1 Non-encoded keyboard interface hardware block diagram

Reference address:3×4 matrix keyboard circuit diagram and assembly language source program

Previous article:Introduction to Integrated Function Generator 8038
Next article:How the keyboard works

Latest Analog Electronics Articles
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号