electro12
Newbie level 1
- Joined
- Mar 27, 2013
- Messages
- 1
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,294
help me with keyboard matrixing 4x4 in microcontroller 89s52
Hello my program is with keyboard matrixing 4x4 in microcontroller 89s52 based in 8951
my problem is the 2 digit this is my code
note: the value for example #7E is 1 for keyboard matrixing 4X4
the keyboard is port 1
MOV A,#7EH ;1 GUARDA EL VALOR
CJNE A,90H,DOS
MOV A,#01H ;DATO
MOVX @DPTR,A
DOS: MOV A,#0BEH ;2
CJNE A,90H,TRES
MOV A,#02H ;DATO
MOVX @DPTR,A
TRES: MOV A,#0DEH ;3
CJNE A,90H,AA
MOV A,#03H ;DATO
MOVX @DPTR,A
AA: MOV A,#0EEH ;A
CJNE A,90H,CUATRO
MOV A,#0AH ;DATO
MOVX @DPTR,A
CUATRO: MOV A,#7DH ;4
CJNE A,90H,CINCO
MOV A,#04H ;DATO
MOVX @DPTR,A
CINCO: MOV A,#0BDH ;5
CJNE A,90H,SEIS
MOV A,#05H ;DATO
MOVX @DPTR,A
SEIS: MOV A,#0DDH ;6
CJNE A,90H,BB
MOV A,#06H ;DATO
MOVX @DPTR,A
BB: MOV A,#0EDH ;B
CJNE A,90H,SIETE
MOV A,#0BH ;DATO
MOVX @DPTR,A
SIETE: MOV A,#7BH ;7
CJNE A,90H,OCHO
MOV A,#07H ;DATO
MOVX @DPTR,A
OCHO: MOV A,#0BBH ;8
CJNE A,90H,NUEVE
MOV A,#08H ;DATO
MOVX @DPTR,A
NUEVE: MOV A,#0DBH ;9
CJNE A,90H,CC
MOV A,#09H ;DATO
MOVX @DPTR,A
CC: MOV A,#0EBH ;C
CJNE A,90H,ASTERISCO
MOV A,#0CH ;DATO
MOVX @DPTR,A
ASTERISCO: MOV A,#77H ;*F
CJNE A,90H,CERO
MOV A,#0FH ;DATO
MOVX @DPTR,A
CERO: MOV A,#0B7H ;0
CJNE A,90H,NUMERAL
MOV A,#00H ;DATO
MOVX @DPTR,A
NUMERAL: MOV A,#0D7H ;#E
CJNE A,90H,DDD
MOV A,#0EH ;DATO
MOVX @DPTR,A
DDD: MOV A,#0E7H ;D
; COMPARA LOS DATOS Y MUESTRA
END
Hello my program is with keyboard matrixing 4x4 in microcontroller 89s52 based in 8951
my problem is the 2 digit this is my code
note: the value for example #7E is 1 for keyboard matrixing 4X4
the keyboard is port 1
MOV A,#7EH ;1 GUARDA EL VALOR
CJNE A,90H,DOS
MOV A,#01H ;DATO
MOVX @DPTR,A
DOS: MOV A,#0BEH ;2
CJNE A,90H,TRES
MOV A,#02H ;DATO
MOVX @DPTR,A
TRES: MOV A,#0DEH ;3
CJNE A,90H,AA
MOV A,#03H ;DATO
MOVX @DPTR,A
AA: MOV A,#0EEH ;A
CJNE A,90H,CUATRO
MOV A,#0AH ;DATO
MOVX @DPTR,A
CUATRO: MOV A,#7DH ;4
CJNE A,90H,CINCO
MOV A,#04H ;DATO
MOVX @DPTR,A
CINCO: MOV A,#0BDH ;5
CJNE A,90H,SEIS
MOV A,#05H ;DATO
MOVX @DPTR,A
SEIS: MOV A,#0DDH ;6
CJNE A,90H,BB
MOV A,#06H ;DATO
MOVX @DPTR,A
BB: MOV A,#0EDH ;B
CJNE A,90H,SIETE
MOV A,#0BH ;DATO
MOVX @DPTR,A
SIETE: MOV A,#7BH ;7
CJNE A,90H,OCHO
MOV A,#07H ;DATO
MOVX @DPTR,A
OCHO: MOV A,#0BBH ;8
CJNE A,90H,NUEVE
MOV A,#08H ;DATO
MOVX @DPTR,A
NUEVE: MOV A,#0DBH ;9
CJNE A,90H,CC
MOV A,#09H ;DATO
MOVX @DPTR,A
CC: MOV A,#0EBH ;C
CJNE A,90H,ASTERISCO
MOV A,#0CH ;DATO
MOVX @DPTR,A
ASTERISCO: MOV A,#77H ;*F
CJNE A,90H,CERO
MOV A,#0FH ;DATO
MOVX @DPTR,A
CERO: MOV A,#0B7H ;0
CJNE A,90H,NUMERAL
MOV A,#00H ;DATO
MOVX @DPTR,A
NUMERAL: MOV A,#0D7H ;#E
CJNE A,90H,DDD
MOV A,#0EH ;DATO
MOVX @DPTR,A
DDD: MOV A,#0E7H ;D
; COMPARA LOS DATOS Y MUESTRA
END
Last edited: