SlideShare a Scribd company logo
1 of 6
EN equ P2.0
RS equ P2.1
RW equ P2.2
mov A,#38H ; Setting Up the LCD
lcall command
mov A,#0EH ; Display On
lcall command
mov A,#06H ; Entry Mode
lcall command
mov a,#82H
lcall command
lcall disp ; Function Disp Called
mov a,#02H ; Setting DDRAM Address to Home position
lcall command
lcall delay1
; Displays BOTSKOOL SHOBHIT ON FIRST LINE OF LCD
mov a,#'B'
lcall datw
NOP
mov a,#'0'
lcall datw
NOP
mov a,#'T'
lcall datw
mov a,#'S'
lcall datw
NOP
mov a,#'K'
lcall datw
NOP
mov a,#'0'
lcall datw
NOP
mov a,#'0'
lcall datw
NOP
mov a,#'L'
lcall datw
NOP
mov a,#' '
lcall datw
NOP
mov a,#'S'
lcall datw
NOP
mov a,#'H'
lcall datw
NOP
mov a,#'O'
lcall datw
NOP
mov a,#'B'
lcall datw
NOP
mov a,#'H'
lcall datw
NOP
mov a,#'I'
lcall datw
NOP
mov a,#'T'
lcall datw
MOV A,#255 ; Moving Value 255 to PORT 3
MOV P3,A
; Keypad Scan Begins
sd:
lcall delay1
lcall key1
lcall delay
lcall key2
lcall delay
lcall key3
lcall delay
lcall key4
lcall delay
lcall sd
; Function to Send Commands to LCD
command:
clr RW
clr RS
setB EN
MOV P1,A
lcall delay
clr EN
RET
; Function to Clear the DDRAM Content
clear:
mov A,#01H
lcall command
lcall delay
mov A,#02H ; Set The DDRAM Address to Home Position
lcall command
lcall delay
RET
; Function to Display Data on LCD Screen
datw:
SETB RS
clr RW
SETB EN
MOV P1,A
lcall delay
clr EN
RET
;Function to Display The Key Pressed
datw1:
lcall delay1
lcall disp
lcall delay1
MOV A,R7
lcall datw
RET
; Generating Small Delay
delay:
mov r0,#255
loop: DJNZ r0,loop;
RET
; Generating a Bigger Delay
delay1:
mov r1,#255
loop1: mov r3,#120
loop2: djnz r3,loop2
djnz r1,loop1
RET
; Checking for Key Press on The First Column of 4x4 Matrix
KEY1:
MOV A,r5
MOV r6,A
clr p3.4
MOV A,p3
ANL A,#0FH
MOV r2,A
cjne r2,#14,n1
MOV r7,#'1'
lcall datw1
lcall delay1
n1: cjne r2,#13,n2
mov r7,#'5'
lcall datw1
lcall delay1
n2: cjne r2,#11,n3
mov r7,#'9'
lcall datw1
lcall delay1
n3: cjne r2,#7,n4
mov r7,#'D'
lcall datw1
lcall delay1
n4: lcall delay1
SETB P3.4
RET
; Checking for Key Press on the Second Column of 4x4 Matrix
KEY2:
clr p3.5
MOV A,p3
ANL A,#0FH
MOV r2,A
cjne r2,#14,q1
mov r7,#'2'
lcall datw1
lcall delay1
q1: cjne r2,#13,q2
mov r7,#'6'
lcall datw1
lcall delay1
q2: cjne r2,#11,q3
mov r7,#65; A=65
lcall datw1
lcall delay1
q3: cjne r2,#7,q4
mov r7,#'E'
lcall datw1
lcall delay1
q4: lcall delay
SETB p3.5
RET
; Checking for Key Press On The Third Column of 4x4 Matrix
KEY3:
clr p3.6
MOV A,p3
ANL A,#0FH
MOV r2,A
cjne r2,#14,w1
mov r7,#'3'
lcall datw1
lcall delay1
w1: cjne r2,#13,w2
mov r7,#'7'
lcall datw1
lcall delay1
w2: cjne r2,#11,w3
mov r7,#'B'
lcall datw1
lcall delay1
w3: cjne r2,#7,w4
mov r7,#'F'
lcall datw1
lcall delay1
w4: lcall delay1
SETB p3.6
RET
; Checking for Key Press on the Fourth Column of 4x4 Matrix
KEY4:
clr p3.7
MOV A,p3
ANL A,#0FH
MOV r2,A
cjne r2,#14,e1
mov r7,#'4'
lcall datw1
lcall delay1
e1: cjne r2,#13,e2
mov r7,#'8'
lcall datw1
lcall delay1
e2: cjne r2,#11,e3
mov r7,#'C'
lcall datw1
lcall delay1
e3: cjne r2,#7,e4
mov r7,#'G'
lcall datw1
lcall delay1
e4: lcall delay1
SETB p3.7
RET
disp:
mov a,#0c0H ; Setting DDRAM Address on Second Line
lcall command
; Clearing the Previous Key Pressed Information from Screen
mov a,#' '
lcall datw
mov a,#' '
lcall datw
mov a,#' '
lcall datw
mov a,#' '
lcall datw
mov a,#' '
lcall datw
mov a,#' '
lcall datw
mov a,#0c0H ; Setting DDRAM Address on Second Line To Display “Key Pressed”
lcall command
; Display "KEY" and Pressed Information
mov a,#' '
lcall datw
mov a,#'K'
lcall datw
mov a,#'E'
lcall datw
mov a,#'Y'
lcall datw
mov a,#' '
lcall datw
RET
END
The code was written when I was learning assembly language myself and therefore the code is not
optimized, but it is easy to understand if someone is willing to check the instruction set.
People who want to optimize the code may wish to look into the DPTR Register and Addressing Modes
Theory.
A View of the Simulation
Kepad lcd 8051

More Related Content

What's hot

Nxll22 role based cli
Nxll22 role based cliNxll22 role based cli
Nxll22 role based cliNetwax Lab
 
Nxll19 vrrp (virtual router redundancy protocol)
Nxll19 vrrp (virtual router redundancy protocol)Nxll19 vrrp (virtual router redundancy protocol)
Nxll19 vrrp (virtual router redundancy protocol)Netwax Lab
 
Ericsson commond list, bss+nss=oss
Ericsson commond list, bss+nss=ossEricsson commond list, bss+nss=oss
Ericsson commond list, bss+nss=ossHossein Abbasi
 
Eincop Netwax Lab: Access List ii
Eincop Netwax Lab: Access List iiEincop Netwax Lab: Access List ii
Eincop Netwax Lab: Access List iiNetwax Lab
 
Docfoc.com ericsson commands
Docfoc.com ericsson commandsDocfoc.com ericsson commands
Docfoc.com ericsson commandsadel kaoubi
 
Eincop Netwax Lab: Redistribution
Eincop Netwax Lab: RedistributionEincop Netwax Lab: Redistribution
Eincop Netwax Lab: RedistributionNetwax Lab
 
Nxll12 zone based firewall
Nxll12 zone based firewallNxll12 zone based firewall
Nxll12 zone based firewallNetwax Lab
 
Nxll21 ospf filtering & summarization
Nxll21 ospf filtering & summarizationNxll21 ospf filtering & summarization
Nxll21 ospf filtering & summarizationNetwax Lab
 
Nxll28 ospf iii
Nxll28 ospf iiiNxll28 ospf iii
Nxll28 ospf iiiNetwax Lab
 
Eincop Netwax Lab: EIGRP ii
Eincop Netwax Lab: EIGRP iiEincop Netwax Lab: EIGRP ii
Eincop Netwax Lab: EIGRP iiNetwax Lab
 

What's hot (20)

Nxll22 role based cli
Nxll22 role based cliNxll22 role based cli
Nxll22 role based cli
 
Nxll19 vrrp (virtual router redundancy protocol)
Nxll19 vrrp (virtual router redundancy protocol)Nxll19 vrrp (virtual router redundancy protocol)
Nxll19 vrrp (virtual router redundancy protocol)
 
Ericsson commond list, bss+nss=oss
Ericsson commond list, bss+nss=ossEricsson commond list, bss+nss=oss
Ericsson commond list, bss+nss=oss
 
Eincop Netwax Lab: Access List ii
Eincop Netwax Lab: Access List iiEincop Netwax Lab: Access List ii
Eincop Netwax Lab: Access List ii
 
Flip flops
Flip flopsFlip flops
Flip flops
 
Nxll26 bgp ii
Nxll26 bgp iiNxll26 bgp ii
Nxll26 bgp ii
 
Docfoc.com ericsson commands
Docfoc.com ericsson commandsDocfoc.com ericsson commands
Docfoc.com ericsson commands
 
854 f wiring
854 f wiring854 f wiring
854 f wiring
 
Eincop Netwax Lab: Redistribution
Eincop Netwax Lab: RedistributionEincop Netwax Lab: Redistribution
Eincop Netwax Lab: Redistribution
 
DMVPN
DMVPNDMVPN
DMVPN
 
Nxll24 i pv6
Nxll24 i pv6Nxll24 i pv6
Nxll24 i pv6
 
Bolascriollas
BolascriollasBolascriollas
Bolascriollas
 
Nxll12 zone based firewall
Nxll12 zone based firewallNxll12 zone based firewall
Nxll12 zone based firewall
 
Nxll21 ospf filtering & summarization
Nxll21 ospf filtering & summarizationNxll21 ospf filtering & summarization
Nxll21 ospf filtering & summarization
 
Digital Counter 0-999
Digital Counter 0-999Digital Counter 0-999
Digital Counter 0-999
 
Cable
CableCable
Cable
 
Nxll28 ospf iii
Nxll28 ospf iiiNxll28 ospf iii
Nxll28 ospf iii
 
Eincop Netwax Lab: EIGRP ii
Eincop Netwax Lab: EIGRP iiEincop Netwax Lab: EIGRP ii
Eincop Netwax Lab: EIGRP ii
 
Garishma ec
Garishma ecGarishma ec
Garishma ec
 
DMVPN Lab WorkBook
DMVPN Lab WorkBookDMVPN Lab WorkBook
DMVPN Lab WorkBook
 

Similar to Kepad lcd 8051

The_ERICSSON_commands_listed_below_are_f (1) (1).pdf
The_ERICSSON_commands_listed_below_are_f (1) (1).pdfThe_ERICSSON_commands_listed_below_are_f (1) (1).pdf
The_ERICSSON_commands_listed_below_are_f (1) (1).pdfssuser340a0c
 
Applications of microcontroller(8051)
Applications of microcontroller(8051) Applications of microcontroller(8051)
Applications of microcontroller(8051) vijaydeepakg
 
fdocuments.in_the-ericsson-commands.pdf
fdocuments.in_the-ericsson-commands.pdffdocuments.in_the-ericsson-commands.pdf
fdocuments.in_the-ericsson-commands.pdfSaidHaman
 
lb instruments by using microcontroller , Rabi Moirangthem
lb instruments by using microcontroller , Rabi Moirangthemlb instruments by using microcontroller , Rabi Moirangthem
lb instruments by using microcontroller , Rabi MoirangthemRabi Moirangthem
 
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdfShashiKiran664181
 
Topviewsimulator
TopviewsimulatorTopviewsimulator
TopviewsimulatorRashmi
 
Steppert Motor Interfacing With Specific Angle Entered Through Keypad
Steppert Motor Interfacing With Specific Angle Entered Through KeypadSteppert Motor Interfacing With Specific Angle Entered Through Keypad
Steppert Motor Interfacing With Specific Angle Entered Through KeypadAbrar Amin
 
Microcontroller (8051) general and simple alp n cprograms
Microcontroller (8051) general and simple alp n cprogramsMicrocontroller (8051) general and simple alp n cprograms
Microcontroller (8051) general and simple alp n cprogramsVedavyas PBurli
 
14827 unit 4_clocked_flip_flops
14827 unit 4_clocked_flip_flops14827 unit 4_clocked_flip_flops
14827 unit 4_clocked_flip_flopsSandeep Kumar
 
Buy Embedded Systems Projects Online,Buy B tech Projects Online
Buy Embedded Systems Projects Online,Buy B tech Projects OnlineBuy Embedded Systems Projects Online,Buy B tech Projects Online
Buy Embedded Systems Projects Online,Buy B tech Projects OnlineTechnogroovy
 
W8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational ProcessorW8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational ProcessorDaniel Roggen
 
Solutionmanual8051microcontrollerbymazidi
Solutionmanual8051microcontrollerbymazidi Solutionmanual8051microcontrollerbymazidi
Solutionmanual8051microcontrollerbymazidi Ahsan Mehmood
 
Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02
Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02
Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02SURYA DEEPAK
 
lec15_x86procedure_4up.pdf
lec15_x86procedure_4up.pdflec15_x86procedure_4up.pdf
lec15_x86procedure_4up.pdfhasan58964
 
Microcontroller 8051 soft
Microcontroller 8051  softMicrocontroller 8051  soft
Microcontroller 8051 softbaluusa8
 
Taller practico emu8086_galarraga
Taller practico emu8086_galarragaTaller practico emu8086_galarraga
Taller practico emu8086_galarragaFabricio Galárraga
 

Similar to Kepad lcd 8051 (20)

The_ERICSSON_commands_listed_below_are_f (1) (1).pdf
The_ERICSSON_commands_listed_below_are_f (1) (1).pdfThe_ERICSSON_commands_listed_below_are_f (1) (1).pdf
The_ERICSSON_commands_listed_below_are_f (1) (1).pdf
 
Applications of microcontroller(8051)
Applications of microcontroller(8051) Applications of microcontroller(8051)
Applications of microcontroller(8051)
 
fdocuments.in_the-ericsson-commands.pdf
fdocuments.in_the-ericsson-commands.pdffdocuments.in_the-ericsson-commands.pdf
fdocuments.in_the-ericsson-commands.pdf
 
lb instruments by using microcontroller , Rabi Moirangthem
lb instruments by using microcontroller , Rabi Moirangthemlb instruments by using microcontroller , Rabi Moirangthem
lb instruments by using microcontroller , Rabi Moirangthem
 
The propeller
The propellerThe propeller
The propeller
 
7.1 flip flops
7.1 flip flops7.1 flip flops
7.1 flip flops
 
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
 
Topviewsimulator
TopviewsimulatorTopviewsimulator
Topviewsimulator
 
Steppert Motor Interfacing With Specific Angle Entered Through Keypad
Steppert Motor Interfacing With Specific Angle Entered Through KeypadSteppert Motor Interfacing With Specific Angle Entered Through Keypad
Steppert Motor Interfacing With Specific Angle Entered Through Keypad
 
Microcontroller (8051) general and simple alp n cprograms
Microcontroller (8051) general and simple alp n cprogramsMicrocontroller (8051) general and simple alp n cprograms
Microcontroller (8051) general and simple alp n cprograms
 
14827 unit 4_clocked_flip_flops
14827 unit 4_clocked_flip_flops14827 unit 4_clocked_flip_flops
14827 unit 4_clocked_flip_flops
 
Buy Embedded Systems Projects Online,Buy B tech Projects Online
Buy Embedded Systems Projects Online,Buy B tech Projects OnlineBuy Embedded Systems Projects Online,Buy B tech Projects Online
Buy Embedded Systems Projects Online,Buy B tech Projects Online
 
W8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational ProcessorW8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational Processor
 
Solutionmanual8051microcontrollerbymazidi
Solutionmanual8051microcontrollerbymazidi Solutionmanual8051microcontrollerbymazidi
Solutionmanual8051microcontrollerbymazidi
 
Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02
Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02
Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
 
lec15_x86procedure_4up.pdf
lec15_x86procedure_4up.pdflec15_x86procedure_4up.pdf
lec15_x86procedure_4up.pdf
 
Expt 5 matrix.docx
Expt 5 matrix.docxExpt 5 matrix.docx
Expt 5 matrix.docx
 
Microcontroller 8051 soft
Microcontroller 8051  softMicrocontroller 8051  soft
Microcontroller 8051 soft
 
Taller practico emu8086_galarraga
Taller practico emu8086_galarragaTaller practico emu8086_galarraga
Taller practico emu8086_galarraga
 

More from sakru naik

Power Theft Identification System Using Iot
Power Theft Identification System Using IotPower Theft Identification System Using Iot
Power Theft Identification System Using Iotsakru naik
 
An automated low cost IoT based Fertilizer Intimation System forsmart agricul...
An automated low cost IoT based Fertilizer Intimation System forsmart agricul...An automated low cost IoT based Fertilizer Intimation System forsmart agricul...
An automated low cost IoT based Fertilizer Intimation System forsmart agricul...sakru naik
 
Health monoring System
Health monoring SystemHealth monoring System
Health monoring Systemsakru naik
 
C 14-deee-v&vi sems
C 14-deee-v&vi semsC 14-deee-v&vi sems
C 14-deee-v&vi semssakru naik
 
Eee r16 syllabus
Eee r16 syllabusEee r16 syllabus
Eee r16 syllabussakru naik
 
An improved dft based channel estimation
An improved dft based channel estimationAn improved dft based channel estimation
An improved dft based channel estimationsakru naik
 

More from sakru naik (8)

Power Theft Identification System Using Iot
Power Theft Identification System Using IotPower Theft Identification System Using Iot
Power Theft Identification System Using Iot
 
An automated low cost IoT based Fertilizer Intimation System forsmart agricul...
An automated low cost IoT based Fertilizer Intimation System forsmart agricul...An automated low cost IoT based Fertilizer Intimation System forsmart agricul...
An automated low cost IoT based Fertilizer Intimation System forsmart agricul...
 
Health monoring System
Health monoring SystemHealth monoring System
Health monoring System
 
C 14-deee-v&vi sems
C 14-deee-v&vi semsC 14-deee-v&vi sems
C 14-deee-v&vi sems
 
Eee r16 syllabus
Eee r16 syllabusEee r16 syllabus
Eee r16 syllabus
 
Ec lab viva
Ec lab vivaEc lab viva
Ec lab viva
 
Ijst 131202
Ijst 131202Ijst 131202
Ijst 131202
 
An improved dft based channel estimation
An improved dft based channel estimationAn improved dft based channel estimation
An improved dft based channel estimation
 

Recently uploaded

Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086anil_gaur
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf203318pmpc
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 

Recently uploaded (20)

Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 

Kepad lcd 8051

  • 1. EN equ P2.0 RS equ P2.1 RW equ P2.2 mov A,#38H ; Setting Up the LCD lcall command mov A,#0EH ; Display On lcall command mov A,#06H ; Entry Mode lcall command mov a,#82H lcall command lcall disp ; Function Disp Called mov a,#02H ; Setting DDRAM Address to Home position lcall command lcall delay1 ; Displays BOTSKOOL SHOBHIT ON FIRST LINE OF LCD mov a,#'B' lcall datw NOP mov a,#'0' lcall datw NOP mov a,#'T' lcall datw mov a,#'S' lcall datw NOP mov a,#'K' lcall datw NOP mov a,#'0' lcall datw NOP mov a,#'0' lcall datw NOP mov a,#'L' lcall datw NOP mov a,#' ' lcall datw NOP mov a,#'S' lcall datw NOP mov a,#'H' lcall datw NOP mov a,#'O' lcall datw NOP mov a,#'B' lcall datw NOP mov a,#'H' lcall datw NOP mov a,#'I'
  • 2. lcall datw NOP mov a,#'T' lcall datw MOV A,#255 ; Moving Value 255 to PORT 3 MOV P3,A ; Keypad Scan Begins sd: lcall delay1 lcall key1 lcall delay lcall key2 lcall delay lcall key3 lcall delay lcall key4 lcall delay lcall sd ; Function to Send Commands to LCD command: clr RW clr RS setB EN MOV P1,A lcall delay clr EN RET ; Function to Clear the DDRAM Content clear: mov A,#01H lcall command lcall delay mov A,#02H ; Set The DDRAM Address to Home Position lcall command lcall delay RET ; Function to Display Data on LCD Screen datw: SETB RS clr RW SETB EN MOV P1,A lcall delay clr EN RET ;Function to Display The Key Pressed datw1: lcall delay1 lcall disp lcall delay1 MOV A,R7 lcall datw RET
  • 3. ; Generating Small Delay delay: mov r0,#255 loop: DJNZ r0,loop; RET ; Generating a Bigger Delay delay1: mov r1,#255 loop1: mov r3,#120 loop2: djnz r3,loop2 djnz r1,loop1 RET ; Checking for Key Press on The First Column of 4x4 Matrix KEY1: MOV A,r5 MOV r6,A clr p3.4 MOV A,p3 ANL A,#0FH MOV r2,A cjne r2,#14,n1 MOV r7,#'1' lcall datw1 lcall delay1 n1: cjne r2,#13,n2 mov r7,#'5' lcall datw1 lcall delay1 n2: cjne r2,#11,n3 mov r7,#'9' lcall datw1 lcall delay1 n3: cjne r2,#7,n4 mov r7,#'D' lcall datw1 lcall delay1 n4: lcall delay1 SETB P3.4 RET ; Checking for Key Press on the Second Column of 4x4 Matrix KEY2: clr p3.5 MOV A,p3 ANL A,#0FH MOV r2,A cjne r2,#14,q1 mov r7,#'2' lcall datw1 lcall delay1 q1: cjne r2,#13,q2 mov r7,#'6'
  • 4. lcall datw1 lcall delay1 q2: cjne r2,#11,q3 mov r7,#65; A=65 lcall datw1 lcall delay1 q3: cjne r2,#7,q4 mov r7,#'E' lcall datw1 lcall delay1 q4: lcall delay SETB p3.5 RET ; Checking for Key Press On The Third Column of 4x4 Matrix KEY3: clr p3.6 MOV A,p3 ANL A,#0FH MOV r2,A cjne r2,#14,w1 mov r7,#'3' lcall datw1 lcall delay1 w1: cjne r2,#13,w2 mov r7,#'7' lcall datw1 lcall delay1 w2: cjne r2,#11,w3 mov r7,#'B' lcall datw1 lcall delay1 w3: cjne r2,#7,w4 mov r7,#'F' lcall datw1 lcall delay1 w4: lcall delay1 SETB p3.6 RET ; Checking for Key Press on the Fourth Column of 4x4 Matrix KEY4: clr p3.7 MOV A,p3 ANL A,#0FH MOV r2,A cjne r2,#14,e1 mov r7,#'4' lcall datw1 lcall delay1 e1: cjne r2,#13,e2 mov r7,#'8' lcall datw1 lcall delay1 e2: cjne r2,#11,e3 mov r7,#'C' lcall datw1
  • 5. lcall delay1 e3: cjne r2,#7,e4 mov r7,#'G' lcall datw1 lcall delay1 e4: lcall delay1 SETB p3.7 RET disp: mov a,#0c0H ; Setting DDRAM Address on Second Line lcall command ; Clearing the Previous Key Pressed Information from Screen mov a,#' ' lcall datw mov a,#' ' lcall datw mov a,#' ' lcall datw mov a,#' ' lcall datw mov a,#' ' lcall datw mov a,#' ' lcall datw mov a,#0c0H ; Setting DDRAM Address on Second Line To Display “Key Pressed” lcall command ; Display "KEY" and Pressed Information mov a,#' ' lcall datw mov a,#'K' lcall datw mov a,#'E' lcall datw mov a,#'Y' lcall datw mov a,#' ' lcall datw RET END The code was written when I was learning assembly language myself and therefore the code is not optimized, but it is easy to understand if someone is willing to check the instruction set. People who want to optimize the code may wish to look into the DPTR Register and Addressing Modes Theory. A View of the Simulation