0% found this document useful (0 votes)
84 views3 pages

4 4 Keypad Interfacing With 8051

The document defines code for an LCD and keypad interface. It connects the LCD to port 1 and keypad to port 2. It initializes the LCD and defines routines to write characters and delay. It also defines keypad buttons from 1-12 mapped to ports and jumps to corresponding routines on button press. The main routine initializes everything and loops continuously checking the keypad ports.

Uploaded by

Vishal Sharma
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views3 pages

4 4 Keypad Interfacing With 8051

The document defines code for an LCD and keypad interface. It connects the LCD to port 1 and keypad to port 2. It initializes the LCD and defines routines to write characters and delay. It also defines keypad buttons from 1-12 mapped to ports and jumps to corresponding routines on button press. The main routine initializes everything and loops continuously checking the keypad ports.

Uploaded by

Vishal Sharma
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

; LCD ic connected to PORT1 : KEYPAD is conected to PoRT2 rs equ P3.0 en equ P3.

1 T_A T_B T_C T_D T_1 T_2 T_3 equ equ equ equ equ equ equ P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 P2.6

ORG 00H MOV P2,#0FFH LJMP MAIN init: mov a,#01h acall command mov a,#38h acall command mov a,#0ch acall command mov a,#06h Lcall command ret command: clr rs setb en mov p1,a Lcall delay clr en ret KP: LCALL WRITE_CHR LCALL DELAY RET B1: MOV A,#'1' LCALL KP LJMP KEYPAD1 B2: MOV A,#'2' LCALL KP LJMP KEYPAD2 B3: MOV A,#'3' LCALL KP LJMP KEYPAD3 B4: MOV A,#'4'

LCALL KP LJMP KEYPAD4 B5: MOV A,#'5' LCALL KP LJMP KEYPAD5 B6: MOV A,#'6' LCALL KP LJMP KEYPAD6 B7: MOV A,#'7' LCALL KP LJMP KEYPAD7 B8: MOV A,#'8' LCALL KP LJMP KEYPAD8 B9: MOV A,#'9' LCALL KP LJMP KEYPAD9 B10: MOV A,#'*' LCALL KP LJMP KEYPAD10 B11: MOV A,#'0' LCALL KP LJMP KEYPAD11 B12: MOV A,#'#' LCALL KP LJMP KEYPAD12 B1_1: lcall B1 B1_2: lcall B2 B1_3: lcall B3 B1_4: lcall B4 MAIN: LCALL init KEYPAD: CLR T_A JNB T_1,B1_1 KEYPAD1: JNB T_2,B1_2 KEYPAD2:

JNB T_3,B1_3 KEYPAD3: SETB T_A CLR T_B JNB T_1,B1_4 KEYPAD4: JNB T_2,B5 KEYPAD5: JNB T_3,B6 KEYPAD6: SETB T_B CLR T_C JNB T_1,B7 KEYPAD7: JNB T_2,B8 KEYPAD8: JNB T_3,B9 KEYPAD9: SETB T_C CLR T_D JNB T_1,B10 KEYPAD10: JNB T_2,B11 KEYPAD11: JNB T_3,B12 KEYPAD12: SETB T_D LJMP KEYPAD STOP: SJMP STOP END data1: setb rs setb en mov p1,a Lcall delay clr en ret DELAY: MOV TMOD,#01H MOV R1,#4H XY: MOV TH0,#3ch MOV TL0,#0bah SETB TR0 JNB TF0,$ CLR TF0 CLR TR0 DJNZ R1,XY RET

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy