SlideShare a Scribd company logo
1 of 17
Dr. Vithalrao Vikhe Patil College of Engineering,
Ahmednagar
Department of Information Technology
Lecture on
Unit No 6
LCD Interfacing with 8051 Microcontroller
Processor Architecture & Interfacing (S.E.I.T.)
Presentation By
Prof. Ms. M. S. Gunjal
Department of Information Technology
Objectives
 What is LCD
 Pin diagram of LCD
 Commands of LCD
 Cursor Address of different LCD
 Interfacing Diagram of LCD with 8051
 Assembly language program of interfacing
April 23, 2020 2
 LCD Stands for "Liquid Crystal Display."
 LCD is a flat panel display technology
commonly used in TVs and computer monitors.
 It is also used in screens for mobile devices,
such as laptops, tablets.
 It has ability to display numbers, characters
and graphics.
LCD?
April 23, 2020 3
Pin Diagram
April 23, 2020 4
Pin Diagram Description
Pin Symbol I/O Descriptions
1 VCC ……. +5 volt power supply
2 VSS …….. Ground
3 VEE …… Power Supply to Contrast
4 RS I Register Select( 0 for command register and 1
for data register)
5 R/W# I 1 for Read
0 for write
6 E I/0 Enable
7-14 DB0-DB7 I/0 The 8-bit data bus
15 LED + …… Usually Connected t0 +5v of power supply
16 LED - ……. Connected to Ground
April 23, 2020 5
16× 2 LCD
April 23, 2020 6
LCD Command Codes
Code
(Hex)
Command to LCD Instruction Register
1 Clear display screen
2 Return home
4 Decrement cursor (shift cursor to left)
6 Increment cursor (shift cursor to right)
5 Shift display right
7 Shift display left
8 Display off, cursor off
A Display off, cursor on
C Display on, cursor off
E Display on, cursor on
F Display on, cursor blinking
April 23, 2020 7
Continued….
Code
(Hex)
Command to LCD Instruction Register
10 Shift cursor position to left
14 Shift cursor position to Right
18 Shift the entire display to the left
1C Shift the entire display to the Right
80 Force cursor to beginning to 1st line
C0 Force cursor to beginning to 2nd line
38 2 lines and 5x7 matrix
April 23, 2020 8
Cursor Addresses
April 23, 2020 9
Interfacing diagram
April 23, 2020 10
Program
 Assembly Language Program to
communicate 16×2 LCD with 8051
Microcontroller.
April 23, 2020 11
Important Points while
Programming
 A high to low pulse should be provided in an
enable pin for Write Operation
 A low to high pulse should be provided in an
enable pin for Read Operation
 Bit D7 of LCD is busy flag which can be used
to check if LCD is busy in its own internal
operation
 Busy flag can be read when R/W =1 and
RS=0 and a L to H pulse in enable pin
April 23, 2020 12
April 23, 2020 13
Program
 P1.0-p1.7 are connected to LCD data pins D0-D7
 P2.0 is connected to RS pin of LCD
 P2.1 is connected to R/W pin of LCD
 P2.2 is connected to E pin of LCD
ORG 00H
MOV A,#38H ;init.LCD 2 Lines
ACALL COMMAND ;call command subroutine
ACALL DELAY ;give LCD some time
MOV A,#0EH ; display on,cursor on
ACALL COMMAND ;call command subroutine
ACALL DELAY ; give LCD some time
MOV A,#01h ;clear LCD
ACALL COMMAND ; call command subroutine
ACALL DELAY ;give LCD some time
MOV A,#06H ;shift cursor right
ACALL COMMAND ;call command subroutine
ACALL DELAY ;give LCD some time
April 23, 2020 14
Program Continue..
MOV A,#84H ;cursor at line 1,pos.4
ACALL COMMAND ;call command subroutine
ACALL DELAY ;give LCD some time
MOV A,#’N’ ;display letter N
ACALL DATA1 ;call display subroutine
ACALL DELAY ;give LCD some time
MOV A,#’O’ ; display letter O
ACALL DATA1 ;call display subroutine
ACALL DELAY ;give LCD some time
Again:SJMP Again
COMMAND: MOV P1,A ;copy regi.A to port 1
CLR P2.0 ;RS=0 for command
CLR P2.1 ;R/W=0 for write
SETB P2.2 ;E=1 for high pulse
ACALL DELAY ;give some time LCD
CLR P2.2 ;E=0 for H-to –L pulse
RET
April 23, 2020 15
Program Continue…
DATA1: MOV P1,A ;write data to LCD
SETB P2.0 ;RS=1 for data
CLR P2.1 ;R/W=0 for write
SETB P2.2 ;E=1 for high pulse
ACALL DELAY ;give some time to LCD
CLR P2.2 ;E=0 for H to L pulse
RET
DELAY:MOV R3,#50H ;R3=50
HERE2:MOV R4,#255H ;R4=255
HERE:DJNZ R4,HERE ;decrement jump if not zero
DJNZ R3,HERE2
RET
END
April 23, 2020 16
Thank You !!!
April 23, 2020 17

More Related Content

Similar to Lcd interfacing1

Lcd interfaing using 8051 and assambly language programming
Lcd interfaing using 8051 and assambly language programmingLcd interfaing using 8051 and assambly language programming
Lcd interfaing using 8051 and assambly language programmingVikas Dongre
 
Lcd interface with atmega32 avr best.ppt
Lcd interface with atmega32 avr best.pptLcd interface with atmega32 avr best.ppt
Lcd interface with atmega32 avr best.pptSoumyaGupta836456
 
Applications of microcontroller(8051)
Applications of microcontroller(8051) Applications of microcontroller(8051)
Applications of microcontroller(8051) vijaydeepakg
 
Moving message display
Moving message displayMoving message display
Moving message displayviraj1989
 
Embedded System Practical manual (1)
Embedded System Practical manual (1)Embedded System Practical manual (1)
Embedded System Practical manual (1)Niraj Bharambe
 
Design, simulation and implementation of an Arduino microcontroller based aut...
Design, simulation and implementation of an Arduino microcontroller based aut...Design, simulation and implementation of an Arduino microcontroller based aut...
Design, simulation and implementation of an Arduino microcontroller based aut...IJAAS Team
 
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSOR
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSORTRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSOR
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSORSubash Sambath Kumar
 
IRJET - Interfacing Multi-Digit 7-Segment with 8051 Microcontroller
IRJET -  	  Interfacing Multi-Digit 7-Segment with 8051 MicrocontrollerIRJET -  	  Interfacing Multi-Digit 7-Segment with 8051 Microcontroller
IRJET - Interfacing Multi-Digit 7-Segment with 8051 MicrocontrollerIRJET Journal
 
SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51 SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51 aroosa khan
 
Topviewsimulator
TopviewsimulatorTopviewsimulator
TopviewsimulatorRashmi
 
4 bit lcd_interfacing_with_arm7_primer
4 bit lcd_interfacing_with_arm7_primer4 bit lcd_interfacing_with_arm7_primer
4 bit lcd_interfacing_with_arm7_primerpvmistary
 

Similar to Lcd interfacing1 (20)

Lcd interfaing using 8051 and assambly language programming
Lcd interfaing using 8051 and assambly language programmingLcd interfaing using 8051 and assambly language programming
Lcd interfaing using 8051 and assambly language programming
 
Lcd interface with atmega32 avr best.ppt
Lcd interface with atmega32 avr best.pptLcd interface with atmega32 avr best.ppt
Lcd interface with atmega32 avr best.ppt
 
Applications of microcontroller(8051)
Applications of microcontroller(8051) Applications of microcontroller(8051)
Applications of microcontroller(8051)
 
Alp lcd
Alp lcdAlp lcd
Alp lcd
 
Moving message display
Moving message displayMoving message display
Moving message display
 
Lcd interfacing
Lcd interfacingLcd interfacing
Lcd interfacing
 
LCD WITH 8051.docx
LCD WITH 8051.docxLCD WITH 8051.docx
LCD WITH 8051.docx
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mci
 
Embedded System Practical manual (1)
Embedded System Practical manual (1)Embedded System Practical manual (1)
Embedded System Practical manual (1)
 
Interfacing with LCD
Interfacing with LCDInterfacing with LCD
Interfacing with LCD
 
mini project
mini projectmini project
mini project
 
Design, simulation and implementation of an Arduino microcontroller based aut...
Design, simulation and implementation of an Arduino microcontroller based aut...Design, simulation and implementation of an Arduino microcontroller based aut...
Design, simulation and implementation of an Arduino microcontroller based aut...
 
Real Time Embedded System
Real Time Embedded SystemReal Time Embedded System
Real Time Embedded System
 
Mini project
Mini projectMini project
Mini project
 
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSOR
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSORTRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSOR
TRAFFIC LIGHT CONTROL SYSTEM USING 8085 MICROPROCESSOR
 
IRJET - Interfacing Multi-Digit 7-Segment with 8051 Microcontroller
IRJET -  	  Interfacing Multi-Digit 7-Segment with 8051 MicrocontrollerIRJET -  	  Interfacing Multi-Digit 7-Segment with 8051 Microcontroller
IRJET - Interfacing Multi-Digit 7-Segment with 8051 Microcontroller
 
Analog to Digital Converter
Analog to Digital ConverterAnalog to Digital Converter
Analog to Digital Converter
 
SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51 SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51
 
Topviewsimulator
TopviewsimulatorTopviewsimulator
Topviewsimulator
 
4 bit lcd_interfacing_with_arm7_primer
4 bit lcd_interfacing_with_arm7_primer4 bit lcd_interfacing_with_arm7_primer
4 bit lcd_interfacing_with_arm7_primer
 

Recently uploaded

NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptAfnanAhmad53
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...jabtakhaidam7
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Ramkumar k
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxpritamlangde
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...vershagrag
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesRashidFaridChishti
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 

Recently uploaded (20)

NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .ppt
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 

Lcd interfacing1

  • 1. Dr. Vithalrao Vikhe Patil College of Engineering, Ahmednagar Department of Information Technology Lecture on Unit No 6 LCD Interfacing with 8051 Microcontroller Processor Architecture & Interfacing (S.E.I.T.) Presentation By Prof. Ms. M. S. Gunjal Department of Information Technology
  • 2. Objectives  What is LCD  Pin diagram of LCD  Commands of LCD  Cursor Address of different LCD  Interfacing Diagram of LCD with 8051  Assembly language program of interfacing April 23, 2020 2
  • 3.  LCD Stands for "Liquid Crystal Display."  LCD is a flat panel display technology commonly used in TVs and computer monitors.  It is also used in screens for mobile devices, such as laptops, tablets.  It has ability to display numbers, characters and graphics. LCD? April 23, 2020 3
  • 5. Pin Diagram Description Pin Symbol I/O Descriptions 1 VCC ……. +5 volt power supply 2 VSS …….. Ground 3 VEE …… Power Supply to Contrast 4 RS I Register Select( 0 for command register and 1 for data register) 5 R/W# I 1 for Read 0 for write 6 E I/0 Enable 7-14 DB0-DB7 I/0 The 8-bit data bus 15 LED + …… Usually Connected t0 +5v of power supply 16 LED - ……. Connected to Ground April 23, 2020 5
  • 6. 16× 2 LCD April 23, 2020 6
  • 7. LCD Command Codes Code (Hex) Command to LCD Instruction Register 1 Clear display screen 2 Return home 4 Decrement cursor (shift cursor to left) 6 Increment cursor (shift cursor to right) 5 Shift display right 7 Shift display left 8 Display off, cursor off A Display off, cursor on C Display on, cursor off E Display on, cursor on F Display on, cursor blinking April 23, 2020 7
  • 8. Continued…. Code (Hex) Command to LCD Instruction Register 10 Shift cursor position to left 14 Shift cursor position to Right 18 Shift the entire display to the left 1C Shift the entire display to the Right 80 Force cursor to beginning to 1st line C0 Force cursor to beginning to 2nd line 38 2 lines and 5x7 matrix April 23, 2020 8
  • 11. Program  Assembly Language Program to communicate 16×2 LCD with 8051 Microcontroller. April 23, 2020 11
  • 12. Important Points while Programming  A high to low pulse should be provided in an enable pin for Write Operation  A low to high pulse should be provided in an enable pin for Read Operation  Bit D7 of LCD is busy flag which can be used to check if LCD is busy in its own internal operation  Busy flag can be read when R/W =1 and RS=0 and a L to H pulse in enable pin April 23, 2020 12
  • 14. Program  P1.0-p1.7 are connected to LCD data pins D0-D7  P2.0 is connected to RS pin of LCD  P2.1 is connected to R/W pin of LCD  P2.2 is connected to E pin of LCD ORG 00H MOV A,#38H ;init.LCD 2 Lines ACALL COMMAND ;call command subroutine ACALL DELAY ;give LCD some time MOV A,#0EH ; display on,cursor on ACALL COMMAND ;call command subroutine ACALL DELAY ; give LCD some time MOV A,#01h ;clear LCD ACALL COMMAND ; call command subroutine ACALL DELAY ;give LCD some time MOV A,#06H ;shift cursor right ACALL COMMAND ;call command subroutine ACALL DELAY ;give LCD some time April 23, 2020 14
  • 15. Program Continue.. MOV A,#84H ;cursor at line 1,pos.4 ACALL COMMAND ;call command subroutine ACALL DELAY ;give LCD some time MOV A,#’N’ ;display letter N ACALL DATA1 ;call display subroutine ACALL DELAY ;give LCD some time MOV A,#’O’ ; display letter O ACALL DATA1 ;call display subroutine ACALL DELAY ;give LCD some time Again:SJMP Again COMMAND: MOV P1,A ;copy regi.A to port 1 CLR P2.0 ;RS=0 for command CLR P2.1 ;R/W=0 for write SETB P2.2 ;E=1 for high pulse ACALL DELAY ;give some time LCD CLR P2.2 ;E=0 for H-to –L pulse RET April 23, 2020 15
  • 16. Program Continue… DATA1: MOV P1,A ;write data to LCD SETB P2.0 ;RS=1 for data CLR P2.1 ;R/W=0 for write SETB P2.2 ;E=1 for high pulse ACALL DELAY ;give some time to LCD CLR P2.2 ;E=0 for H to L pulse RET DELAY:MOV R3,#50H ;R3=50 HERE2:MOV R4,#255H ;R4=255 HERE:DJNZ R4,HERE ;decrement jump if not zero DJNZ R3,HERE2 RET END April 23, 2020 16
  • 17. Thank You !!! April 23, 2020 17