ER0,#0FFH,LOOP2MOVR0,#60LOOP2:RETIDELAY:MOVR2,#20DEL0:MOVR3,#50DJNZR3,$DJNZR2,DEL0RETTAB:DB3FH,06H,5BH,4FH,66HDB6DH,7DH,07H,7FH,6FHEND实验五矩阵式键盘的设计一、实验目的:1.掌握键盘设计中按键识别的原则。2.用PROTEUS设计一个常规4×4的矩阵键盘。3.键盘编码规则自己定义,分别对应数字键0-9、A-F,按下对应的按键显示在数码管上显示对应的数据。二、PROTEUS电路设计:三、实验仪器和设备PC机、PROTEUS软件或W-A-51综合开发学习板四、源程序设计: 0000HAJMP 30H START:MOV DPTR,#TABLE MOV P1,#07HHH: MOV P2,#0F0HH1: JB P2.4,H2 MOV A,#00HLJMP LLH2: JB P2.5,H3MOV A,#01HLJMP LLH3: JB P2.6,H4 MOV A,#02HLJMP LLH4: JB P2.7,H1 MOV A,#03HLL: MOV P2,#0FHL1: JB P2.0,L2 MOV R0,#00HLJMP CBL2: JB P2.1,L3 MOV R0,#01HLJMP CBL3: JB P2.2,L4 MOV R0,#02HLJMP CBL4: JB P2.3,L1 MOV R0,#03HCB: MOV B,#04H MUL ABADD A,R0MOVC A,@A+DPTRCPL AMOV P0,ALJMP HHTABLE:DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H DB 7FH,6FH,77H,7CH,39H,5EH,79H,71HEND