SlideShare a Scribd company logo
1 of 19
LCD Interfacing
With 8051 Microprocessor
Group Members
• Hasnain Yaseen EE161021
• Sufyan Nasir EE161036
• Muhammad Ahtsham EE161012
• Usman Ashraf EE161046
Introduction
• LCD display is an inevitable part in almost all embedded projects and this
pre is about interfacing a 16×2 LCD with 8051 microcontroller.
• Many guys take it hard to interface LCD module with the 8051 but the fact
is that if you learn it properly, its a very easy job and by knowing it you
can easily design embedded projects like
• Digital voltmeter / ammeter,
• Digital clock,
• Home automation displays,
• Status indicator display,
• Display for music players etc.
Liquid Crystal Diode (LCD)
• A Liquid Crystal Display (LCD) is a
thin , flat panel display device used
for electronically displaying
information such as text ,images and
moving picture.
• LCD is used in Computer monitors,
Televisions , Instrument panels,
Gaming devices etc.
• Polarization of lights is used here to
display objects.
Why LCD ?
• Smaller size —LCDs occupy approximately 60 percent less space than CRT
displays an important feature when office space is limited.
• Lower power consumption—LCDs typically consume about half the
power and emit much less heat than CRT displays.
• Lighter weight —LCDs weigh approximately 70 percent less than CRT
displays of comparable size.
• No electromagnetic fields —LCDs do not emit electromagnetic fields and
are not susceptible to them. Thus, they are suitable for use in areas where CRTs
cannot be used.
• Longer life —LCDs have a longer useful life than CRTs.
16×2 LCD
• 16×2 LCD module is a very common type of
LCD module that is used in 8051 based
embedded projects.
• It consists of 16 rows and 2Â columns of
5×7 or 5×8 LCD dot
matrices.
• The module were are talking about here is
type number JHD162A which is a very
popular one .
• It is available in a 16 pin package with back
light ,contrast adjustment function .
• Each dot matrix has 5×8 dot resolution
LCD pin Configuration
Pin No: Name  Function
1 VSS This pin must be connected to the ground
2 VCC Â Positive supply voltage pin (5V DC)
3 VEE Contrast adjustment
4 RS RS=0 to select command register, RS=1 to select data register
5 R/W R/W=0 for write, R/W=1 for read
6 E Â Enable
7 DB0 Â Data
8 DB1 Â Data
9 DB2 Â Data
10 DB3 Â Data
11 DB4 Â Data
12 DB5 Â Data
13 DB6 Â Data
14 DB7 Â Data
15 LED+ Â Back light LED+
16 LED- Â Back light LED-
16×2 LCD module commands
Command Function
0F LCD ON, Cursor ON, Cursor blinking ON
01 Clear screen
02 Return home
04 Decrement cursor
06 Increment cursor
0E Display ON ,Cursor blinking OFF
80 Force cursor to the beginning of 1st line
C0 Force cursor to the beginning of 2ndline
16×2 LCD module commands
38 Use 2 lines and 5×7 matrix
83 Cursor line 1 position 3
3C Activate second line
08 Display OFF, Cursor OFF
C1 Jump to second line, position1
OC Display ON, Cursor OFF
C1 Jump to second line, position1
C2 Jump to second line, position2
LCD initialization
• The steps that has to be done for initializing the LCD display is given below and these
steps are common for almost all applications.
• Send 38H (Use 2 lines and 5×7 matrix)to the 8 bit data line for initialization
• Send 0FH for making LCD ON, cursor ON and cursor blinking ON.
• Send 06H for incrementing cursor position.
• Send 01H for clearing the display and return the cursor.
Sending data to the LCD
The steps for sending data to the LCD module is given below. Make R/W low.
• Make RS=0 if data byte is a command and make RS=1 if the data byte is a data to
be displayed.
• Place data byte on the data register.
• Pulse E from high to low.
• Repeat above steps for sending another data
LCD Contrast Control
• LCD display contrast is adjusted through a
variable resistor .
• A potentiometer is connected between the
appropriate power supply rails (Vdd and Vss
for single supply, and Vee and Vdd for
higher voltage LCD modules). The wiper of
the pot is connected to Vo (LCD bias voltage
input, see below). The LCD is then
positioned at the nominal viewing position,
and the pot is adjusted to obtain the desired
LCD appearance
LCD Timing for Read
LCD Timing for Write
Interfacing 16×2 LCD with 8051
Code for LCD Interfacing
• ORG 0000
• MOV A,#38H ; initialize. LCD 2 lines, 5x7 Matrix.
• ACALL COMNWRT ; Call command Subroutine
• ACALL DELAY ; Give LCD some time.
• MOV A, #0EH ; Display on, cursor on.
• ACALL COMNWRT ; Call command Subroutine.
• ACALL DELAY ; Give LCD some time. MOV A, # 01 ; Clear
LCD.
• ACALL COMNWRT ; Call command subroutine
• ; ACALL DELAY ; Give LCD sometime
• MOV A, # 06H ; Shift cursor right.
• ACALL COMNWRT ; ACALL DELAY
• BACK: MOV A, #82H ; Cursor at line 1 position 2
• ACALL COMNWRT ; Call command subroutine.
• ; ACALL DELAY ; Give LCD some time
• ; // MESSAGE DISPLY
• MOV A, #'F' ; Display letter F
• ACALL DATAWRT ; Call Data command subroutine
• MOV A, #'A' ; Display letter A
• ACALL DATAWRT ; Call Data command subroutine
• MOV A, #'J' ; Display letter J
• ACALL DATAWRT ; Call Data command subroutine
• MOV A, #'R' ; Display letter R
Code for LCD Interfacing
• MOV A, #01 ; Clear screen
• ACALL COMNWRT ; Call Data command subroutine
• SJMP BACK ; Keep displaying these letters
• ; AGAIN: SJMP AGAIN
• COMNWRT:
• MOV P1, A
• CLR P3.0; RS=0 FOR COMMAND WRITE
• CLR P3.1; R/W=0FOR WRITE
• SETB P3.2; E=1 FOR HIGH PUSLSE
• CLR P3.2 ;E=0 FOR H-TO-L PULSE
• RET
• DATAWRT:
• MOV P1, A; WRITE DATA TO LCD
• SETB P3.0; RS=1 FOR DATA
• CLR P3.1; R/W=0 F0R WRITE
• SETB P3.2; E=1 FOR HIGH PULSE
• CLR P3.2; E=0 FOR H-TO-L PULSE
• RET
• DELAY:
• MOV R4, #1
• HERE: DJNZ R4, HERE
• RET
• END
Thank You

More Related Content

What's hot

Calculator design with lcd using fpga
Calculator design with lcd using fpgaCalculator design with lcd using fpga
Calculator design with lcd using fpgaHossam Hassan
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerSudhanshu Janwadkar
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil KawareProf. Swapnil V. Kaware
 
Interfacing external memory in 8051
Interfacing external memory in 8051Interfacing external memory in 8051
Interfacing external memory in 8051ssuser3a47cb
 
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
 
Interfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessorInterfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessorVikas Gupta
 
Interfacing adc
Interfacing adcInterfacing adc
Interfacing adcPRADEEP
 
(D/A) and (A/D)conversion
(D/A) and (A/D)conversion(D/A) and (A/D)conversion
(D/A) and (A/D)conversionPraveen Kumar
 
555 timer as Astable Multivibrator
555 timer as Astable Multivibrator555 timer as Astable Multivibrator
555 timer as Astable MultivibratorChandul4y
 
Key board interfacing with 8051
Key board interfacing with 8051Key board interfacing with 8051
Key board interfacing with 8051DominicHendry
 
temperature control using 8086 microprocessor by vikas arya
temperature control using 8086 microprocessor by vikas arya temperature control using 8086 microprocessor by vikas arya
temperature control using 8086 microprocessor by vikas arya VIKAS ARYA
 

What's hot (20)

Calculator design with lcd using fpga
Calculator design with lcd using fpgaCalculator design with lcd using fpga
Calculator design with lcd using fpga
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 Microcontroller
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware
 
Interfacing external memory in 8051
Interfacing external memory in 8051Interfacing external memory in 8051
Interfacing external memory in 8051
 
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
 
CISC & RISC Architecture
CISC & RISC Architecture CISC & RISC Architecture
CISC & RISC Architecture
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 
Interfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessorInterfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessor
 
8086 micro processor
8086 micro processor8086 micro processor
8086 micro processor
 
Processors selection
Processors selectionProcessors selection
Processors selection
 
Interfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 MicrocontrollerInterfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 Microcontroller
 
Interfacing adc
Interfacing adcInterfacing adc
Interfacing adc
 
(D/A) and (A/D)conversion
(D/A) and (A/D)conversion(D/A) and (A/D)conversion
(D/A) and (A/D)conversion
 
555 timer as Astable Multivibrator
555 timer as Astable Multivibrator555 timer as Astable Multivibrator
555 timer as Astable Multivibrator
 
Embedded c
Embedded cEmbedded c
Embedded c
 
Key board interfacing with 8051
Key board interfacing with 8051Key board interfacing with 8051
Key board interfacing with 8051
 
Synchronous Counter
Synchronous Counter Synchronous Counter
Synchronous Counter
 
temperature control using 8086 microprocessor by vikas arya
temperature control using 8086 microprocessor by vikas arya temperature control using 8086 microprocessor by vikas arya
temperature control using 8086 microprocessor by vikas arya
 
Interrupts in 8051
Interrupts in 8051Interrupts in 8051
Interrupts in 8051
 
Interfacing 8255
Interfacing 8255Interfacing 8255
Interfacing 8255
 

Similar to Lcd interfacing with microprocessor 8051

Liquid crystal display
Liquid crystal displayLiquid crystal display
Liquid crystal displayVraj Patel
 
Unit iv microcontrollers final
Unit iv microcontrollers finalUnit iv microcontrollers final
Unit iv microcontrollers finalSARITHA REDDY
 
Moving message display
Moving message displayMoving message display
Moving message displayviraj1989
 
Digital voltmeter using 89c51 microcontroller
Digital voltmeter using 89c51 microcontrollerDigital voltmeter using 89c51 microcontroller
Digital voltmeter using 89c51 microcontrollerSaylee joshi
 
Applications of microcontroller(8051)
Applications of microcontroller(8051) Applications of microcontroller(8051)
Applications of microcontroller(8051) vijaydeepakg
 
20080523_SID_71-1_Wenchih
20080523_SID_71-1_Wenchih20080523_SID_71-1_Wenchih
20080523_SID_71-1_WenchihWen-Chih Tai
 
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
 
AVR_Course_Day5 avr interfaces
AVR_Course_Day5 avr interfacesAVR_Course_Day5 avr interfaces
AVR_Course_Day5 avr interfacesMohamed Ali
 
Micro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL CodeMicro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL CodeSunil Kumar R
 

Similar to Lcd interfacing with microprocessor 8051 (20)

Lcd
LcdLcd
Lcd
 
LCD WITH 8051.docx
LCD WITH 8051.docxLCD WITH 8051.docx
LCD WITH 8051.docx
 
Lcd interfacing
Lcd interfacingLcd interfacing
Lcd interfacing
 
Liquid crystal display
Liquid crystal displayLiquid crystal display
Liquid crystal display
 
8051.pdf
8051.pdf8051.pdf
8051.pdf
 
Hd44780a00 dtasheet
Hd44780a00 dtasheetHd44780a00 dtasheet
Hd44780a00 dtasheet
 
report cs
report csreport cs
report cs
 
Lcd & keypad
Lcd & keypadLcd & keypad
Lcd & keypad
 
Unit iv microcontrollers final
Unit iv microcontrollers finalUnit iv microcontrollers final
Unit iv microcontrollers final
 
Alp lcd
Alp lcdAlp lcd
Alp lcd
 
Moving message display
Moving message displayMoving message display
Moving message display
 
Digital voltmeter using 89c51 microcontroller
Digital voltmeter using 89c51 microcontrollerDigital voltmeter using 89c51 microcontroller
Digital voltmeter using 89c51 microcontroller
 
Applications of microcontroller(8051)
Applications of microcontroller(8051) Applications of microcontroller(8051)
Applications of microcontroller(8051)
 
LCD (2).pptx
LCD (2).pptxLCD (2).pptx
LCD (2).pptx
 
20080523_SID_71-1_Wenchih
20080523_SID_71-1_Wenchih20080523_SID_71-1_Wenchih
20080523_SID_71-1_Wenchih
 
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
 
Arduino based applications part 2
Arduino based applications part 2Arduino based applications part 2
Arduino based applications part 2
 
AVR_Course_Day5 avr interfaces
AVR_Course_Day5 avr interfacesAVR_Course_Day5 avr interfaces
AVR_Course_Day5 avr interfaces
 
Lcd interfacing1
Lcd interfacing1Lcd interfacing1
Lcd interfacing1
 
Micro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL CodeMicro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL Code
 

More from Hasnain Yaseen

Mobile Phone Signal Jammer
Mobile Phone Signal Jammer Mobile Phone Signal Jammer
Mobile Phone Signal Jammer Hasnain Yaseen
 
Z trasnform & Inverse Z-transform in matlab
Z trasnform & Inverse Z-transform in matlabZ trasnform & Inverse Z-transform in matlab
Z trasnform & Inverse Z-transform in matlabHasnain Yaseen
 
Why grades dont matters?
Why grades dont matters?Why grades dont matters?
Why grades dont matters?Hasnain Yaseen
 
Compressor and types of compressors (Thermodynamics)
Compressor and types of compressors (Thermodynamics)Compressor and types of compressors (Thermodynamics)
Compressor and types of compressors (Thermodynamics)Hasnain Yaseen
 
Rotation control of separately excited Dc Motor
Rotation control of separately excited Dc MotorRotation control of separately excited Dc Motor
Rotation control of separately excited Dc MotorHasnain Yaseen
 
Microprocessors historical background
Microprocessors  historical backgroundMicroprocessors  historical background
Microprocessors historical backgroundHasnain Yaseen
 

More from Hasnain Yaseen (6)

Mobile Phone Signal Jammer
Mobile Phone Signal Jammer Mobile Phone Signal Jammer
Mobile Phone Signal Jammer
 
Z trasnform & Inverse Z-transform in matlab
Z trasnform & Inverse Z-transform in matlabZ trasnform & Inverse Z-transform in matlab
Z trasnform & Inverse Z-transform in matlab
 
Why grades dont matters?
Why grades dont matters?Why grades dont matters?
Why grades dont matters?
 
Compressor and types of compressors (Thermodynamics)
Compressor and types of compressors (Thermodynamics)Compressor and types of compressors (Thermodynamics)
Compressor and types of compressors (Thermodynamics)
 
Rotation control of separately excited Dc Motor
Rotation control of separately excited Dc MotorRotation control of separately excited Dc Motor
Rotation control of separately excited Dc Motor
 
Microprocessors historical background
Microprocessors  historical backgroundMicroprocessors  historical background
Microprocessors historical background
 

Recently uploaded

9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 

Recently uploaded (20)

9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

Lcd interfacing with microprocessor 8051

  • 1.
  • 2. LCD Interfacing With 8051 Microprocessor
  • 3. Group Members • Hasnain Yaseen EE161021 • Sufyan Nasir EE161036 • Muhammad Ahtsham EE161012 • Usman Ashraf EE161046
  • 4. Introduction • LCD display is an inevitable part in almost all embedded projects and this pre is about interfacing a 16×2 LCD with 8051 microcontroller. • Many guys take it hard to interface LCD module with the 8051 but the fact is that if you learn it properly, its a very easy job and by knowing it you can easily design embedded projects like • Digital voltmeter / ammeter, • Digital clock, • Home automation displays, • Status indicator display, • Display for music players etc.
  • 5. Liquid Crystal Diode (LCD) • A Liquid Crystal Display (LCD) is a thin , flat panel display device used for electronically displaying information such as text ,images and moving picture. • LCD is used in Computer monitors, Televisions , Instrument panels, Gaming devices etc. • Polarization of lights is used here to display objects.
  • 6. Why LCD ? • Smaller size —LCDs occupy approximately 60 percent less space than CRT displays an important feature when office space is limited. • Lower power consumption—LCDs typically consume about half the power and emit much less heat than CRT displays. • Lighter weight —LCDs weigh approximately 70 percent less than CRT displays of comparable size. • No electromagnetic fields —LCDs do not emit electromagnetic fields and are not susceptible to them. Thus, they are suitable for use in areas where CRTs cannot be used. • Longer life —LCDs have a longer useful life than CRTs.
  • 7. 16×2 LCD • 16×2 LCD module is a very common type of LCD module that is used in 8051 based embedded projects. • It consists of 16 rows and 2Â columns of 5×7 or 5×8 LCD dot matrices. • The module were are talking about here is type number JHD162A which is a very popular one . • It is available in a 16 pin package with back light ,contrast adjustment function . • Each dot matrix has 5×8 dot resolution
  • 8. LCD pin Configuration Pin No: Name  Function 1 VSS This pin must be connected to the ground 2 VCC  Positive supply voltage pin (5V DC) 3 VEE Contrast adjustment 4 RS RS=0 to select command register, RS=1 to select data register 5 R/W R/W=0 for write, R/W=1 for read 6 E  Enable 7 DB0  Data 8 DB1  Data 9 DB2  Data 10 DB3  Data 11 DB4  Data 12 DB5  Data 13 DB6  Data 14 DB7  Data 15 LED+  Back light LED+ 16 LED-  Back light LED-
  • 9. 16×2 LCD module commands Command Function 0F LCD ON, Cursor ON, Cursor blinking ON 01 Clear screen 02 Return home 04 Decrement cursor 06 Increment cursor 0E Display ON ,Cursor blinking OFF 80 Force cursor to the beginning of 1st line C0 Force cursor to the beginning of 2ndline
  • 10. 16×2 LCD module commands 38 Use 2 lines and 5×7 matrix 83 Cursor line 1 position 3 3C Activate second line 08 Display OFF, Cursor OFF C1 Jump to second line, position1 OC Display ON, Cursor OFF C1 Jump to second line, position1 C2 Jump to second line, position2
  • 11. LCD initialization • The steps that has to be done for initializing the LCD display is given below and these steps are common for almost all applications. • Send 38H (Use 2 lines and 5×7 matrix)to the 8 bit data line for initialization • Send 0FH for making LCD ON, cursor ON and cursor blinking ON. • Send 06H for incrementing cursor position. • Send 01H for clearing the display and return the cursor.
  • 12. Sending data to the LCD The steps for sending data to the LCD module is given below. Make R/W low. • Make RS=0 if data byte is a command and make RS=1 if the data byte is a data to be displayed. • Place data byte on the data register. • Pulse E from high to low. • Repeat above steps for sending another data
  • 13. LCD Contrast Control • LCD display contrast is adjusted through a variable resistor . • A potentiometer is connected between the appropriate power supply rails (Vdd and Vss for single supply, and Vee and Vdd for higher voltage LCD modules). The wiper of the pot is connected to Vo (LCD bias voltage input, see below). The LCD is then positioned at the nominal viewing position, and the pot is adjusted to obtain the desired LCD appearance
  • 15. LCD Timing for Write
  • 17. Code for LCD Interfacing • ORG 0000 • MOV A,#38H ; initialize. LCD 2 lines, 5x7 Matrix. • ACALL COMNWRT ; Call command Subroutine • ACALL DELAY ; Give LCD some time. • MOV A, #0EH ; Display on, cursor on. • ACALL COMNWRT ; Call command Subroutine. • ACALL DELAY ; Give LCD some time. MOV A, # 01 ; Clear LCD. • ACALL COMNWRT ; Call command subroutine • ; ACALL DELAY ; Give LCD sometime • MOV A, # 06H ; Shift cursor right. • ACALL COMNWRT ; ACALL DELAY • BACK: MOV A, #82H ; Cursor at line 1 position 2 • ACALL COMNWRT ; Call command subroutine. • ; ACALL DELAY ; Give LCD some time • ; // MESSAGE DISPLY • MOV A, #'F' ; Display letter F • ACALL DATAWRT ; Call Data command subroutine • MOV A, #'A' ; Display letter A • ACALL DATAWRT ; Call Data command subroutine • MOV A, #'J' ; Display letter J • ACALL DATAWRT ; Call Data command subroutine • MOV A, #'R' ; Display letter R
  • 18. Code for LCD Interfacing • MOV A, #01 ; Clear screen • ACALL COMNWRT ; Call Data command subroutine • SJMP BACK ; Keep displaying these letters • ; AGAIN: SJMP AGAIN • COMNWRT: • MOV P1, A • CLR P3.0; RS=0 FOR COMMAND WRITE • CLR P3.1; R/W=0FOR WRITE • SETB P3.2; E=1 FOR HIGH PUSLSE • CLR P3.2 ;E=0 FOR H-TO-L PULSE • RET • DATAWRT: • MOV P1, A; WRITE DATA TO LCD • SETB P3.0; RS=1 FOR DATA • CLR P3.1; R/W=0 F0R WRITE • SETB P3.2; E=1 FOR HIGH PULSE • CLR P3.2; E=0 FOR H-TO-L PULSE • RET • DELAY: • MOV R4, #1 • HERE: DJNZ R4, HERE • RET • END