SlideShare a Scribd company logo
1 of 18
Download to read offline
1
04-Interfacing LCD
Displays.
By : Mohamed Fawzy
Programming AVR Microcontrollers
© Mohamed F.A.B 2015
Lecture Notes:
2
o Set Your Phone To Vibration Mode.
o Ask any time.
o During labs, Feel Free To Check Any Materials or
Internet.
o Slides are self content.
o Feel Free To Share This Materials With Your Friends.
o Work Hard For Achieving Most Of This Course.
© Mohamed F.A.B 2015
3
Don't Forget !!!!
© Mohamed F.A.B 2015
Any Expert Was Once A Beginner

4
Lesson(10).
© Mohamed F.A.B 2015
Lesson (10):
Interfacing LCDs displays with Microcontroller.
5
Lesson (10) Topics.
© Mohamed F.A.B 2015
► Intro to LCDs screens.
► LCD Hardware Connections.
► LCD built in Functions in MIKROC.
► Displaying Numbers On LCD.
► How to Display Custom Symbols or Characters on LCD.
► How to Connect Multiple LCD With MC using Same Pins.
► Let's Have Fun With LCD.
6
Intro To LCDs Screens.
© Mohamed F.A.B 2015
 LCD stands for Liquid Crystal Display.
 It can be used to display anything (virtually
anything!).
 There are two common types of LCDs:
 Character LCD : Used For
Displaying Only
Characters, Numbers and
some Custom Symbols.
 Graphical LCD : Used For
Displaying almost
everything (Text, symbols
and images).
“Will be discussed on Level 2”
7
LCDs Memory.
© Mohamed F.A.B 2015
 Memory in LCD divided into Three types:
 DDRAM Memory: storing characters to be
displayed.
 CGROM Memory: contains standard
character map with all characters that
can be displayed on the screen.
 CGRAM Memory: a part from standard
characters, the LCD display can also
display symbols defined by the user itself.
We can use CGRAM to display custom symbols on LCD.
NOTE:
8
LCD Hardware Connections.
© Mohamed F.A.B 2015
• Pins[RS,R/W,EN] Control Lines.
• Pins[D0:D7] Data Lines.
Don't swap power pins to
avoid damaging your LCD.
Take Care:
9
alcd.h functions.
© Mohamed F.A.B 2015
 Initializing the LCD controller
void lcd_init(unsigned char lcd_columns);
EX:
Lcd_init(16); //for 2*16 LCD
 Writing character to LCD
void lcd_putchar(char c);
EX:
Lcd_write (‘A’); //display A on LCD
 Defining position of cursor (x,y)
void lcd_gotoxy(unsigned char x, unsigned char y);
EX:
lcd_gotoxy(0,0); //start from column 0 and row 0
 write the string str located in SRAM to the LCD
void lcd_puts(char *str);
EX:
lcd_puts(“Hello LCD !!!”);
10
alcd.h functions. Cont’
© Mohamed F.A.B 2015
 Clearing the LCD
void lcd_clear(void);
EX:
lcd_clear(); //delete any data on LCD
 Write byte to the LCD character generator or LCD CGRAM
void write_byte(unsigned char address, unsigned char data);
EX:
void write_byte(char0, 0);
 Writing command to LCD
void _lcd_write_data(unsigned char cmd);
EX:
void _lcd_write_data(0x0E); //display LCD cursor
11
LCD useful commands codes.
© Mohamed F.A.B 2015
Code Function
0x0C Cursor OFF
0x0E Cursor underline
0x0F Cursor ON
0x10 Move cursor left by one character.
0x14 Move cursor right by one character.
#define _LCD_CURSOR_OFF 0x0C
#define _LCD_CURSOR_UNDERLINE 0x0E
#define _LCD_CURSOR_ON 0x0F
#define _LCD_CURSOR_LEFT 0x10
#define _LCD_CURSOR_RIGHT 0x14
TIP
12
Displaying Numbers On LCD.
© Mohamed F.A.B 2015
• LCD displays data into ASCII format. ASCII Symbol
Do (00:99) UP Down Counter With Two Buttons.
Exercise:
13
Displaying Custom Symbols On LCD.
© Mohamed F.A.B 2015
 In some cases you may need to
display characters and symbols that
not defined in CGROM.
 You need to define your symbol into
CGRAM.
1
2
3
 We use “LCD Custom Char Builder” to draw our pattern.
http://extremeelectronics.co.in/avrtutorials/download/LCDCustomCharBuilder.zip
14
Displaying Custom Symbols On LCD. Cont’
© Mohamed F.A.B 2015
Exercise:
#include <io.h>
#include <alcd.h>
#include <delay.h>
// Declare your global variables here
flash unsigned char char0[8]={0x0A, 0x1F, 0x1F, 0x1F, 0x1F, 0x0E, 0x04, 0
void define_char(unsigned char flash *pc, unsigned char char_code){
unsigned char i,a;
a=(char_code<<3)|0x040;
for (i=0;i<8;i++)lcd_write_byte(a++,*pc++);
}
void main(void)
{
lcd_init(16);
lcd_gotoxy(0,0);
while (1)
{
define_char(char0,0);
lcd_puts("I ");
lcd_putchar(0);
lcd_puts(" AVR");
}
15
Connecting Multiple LCD with same I/O Pins.
© Mohamed F.A.B 2015
 What if we need to use multiple LCD in one project ??!!!!.
 We can do that using latch IC 74HC573.
 Simply, this IC pass data from input pins to output pins in
case we enables that action.
We need to interface 2 LCDs with MC using
PORTC, then displaying “LCD_1”on first LCD
and displaying “LCD_2” on second LCD.
Exercise:
LCD_1 LCD_2
16
Let's have Fun With LCD .
© Mohamed F.A.B 2015
17
Questions:
© Mohamed F.A.B 2015
Thank You All 
18
mo7amed.fawzy33@gmail.com
01006032792
fawzy.fab@gmail.com
© Mohamed F.A.B 2015

More Related Content

What's hot

Untitled 1
Untitled 1Untitled 1
Untitled 1lakachew
 
Programming avr microcontroller digital i
Programming avr microcontroller digital iProgramming avr microcontroller digital i
Programming avr microcontroller digital iManas Mantri
 
Lcd interfacing with microprocessor 8051
Lcd interfacing with microprocessor 8051Lcd interfacing with microprocessor 8051
Lcd interfacing with microprocessor 8051Hasnain Yaseen
 
Programming the Digital I/O Interface of a PIC microcontroller
Programming the Digital I/O Interface of a PIC microcontrollerProgramming the Digital I/O Interface of a PIC microcontroller
Programming the Digital I/O Interface of a PIC microcontrollerCorrado Santoro
 
1.arm tutorial(gpio)
1.arm tutorial(gpio)1.arm tutorial(gpio)
1.arm tutorial(gpio)Ram Mohan
 
LCD Theory and Working Principles
LCD Theory and Working PrinciplesLCD Theory and Working Principles
LCD Theory and Working PrinciplesRobo India
 
22 Microcontroller Programs
22 Microcontroller Programs22 Microcontroller Programs
22 Microcontroller Programsbabak danyal
 
22 microcontroller programs
22 microcontroller programs22 microcontroller programs
22 microcontroller programsbabak danyal
 

What's hot (20)

Untitled 1
Untitled 1Untitled 1
Untitled 1
 
Interfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 MicrocontrollerInterfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 Microcontroller
 
MPLABX with proteus
MPLABX with proteusMPLABX with proteus
MPLABX with proteus
 
Picmico
PicmicoPicmico
Picmico
 
Programming avr microcontroller digital i
Programming avr microcontroller digital iProgramming avr microcontroller digital i
Programming avr microcontroller digital i
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
PIC and LCD
PIC and LCDPIC and LCD
PIC and LCD
 
Lcd interfacing with microprocessor 8051
Lcd interfacing with microprocessor 8051Lcd interfacing with microprocessor 8051
Lcd interfacing with microprocessor 8051
 
Programming the Digital I/O Interface of a PIC microcontroller
Programming the Digital I/O Interface of a PIC microcontrollerProgramming the Digital I/O Interface of a PIC microcontroller
Programming the Digital I/O Interface of a PIC microcontroller
 
1.arm tutorial(gpio)
1.arm tutorial(gpio)1.arm tutorial(gpio)
1.arm tutorial(gpio)
 
Rig nitc [autosaved] (copy)
Rig nitc [autosaved] (copy)Rig nitc [autosaved] (copy)
Rig nitc [autosaved] (copy)
 
Chapter5 dek3133
Chapter5 dek3133Chapter5 dek3133
Chapter5 dek3133
 
LCD Theory and Working Principles
LCD Theory and Working PrinciplesLCD Theory and Working Principles
LCD Theory and Working Principles
 
22 Microcontroller Programs
22 Microcontroller Programs22 Microcontroller Programs
22 Microcontroller Programs
 
22 microcontroller programs
22 microcontroller programs22 microcontroller programs
22 microcontroller programs
 
LCD interfacing
LCD interfacingLCD interfacing
LCD interfacing
 
LUMOS
LUMOSLUMOS
LUMOS
 
ROBOT MOTION
ROBOT    MOTIONROBOT    MOTION
ROBOT MOTION
 
Lcd interfacing1
Lcd interfacing1Lcd interfacing1
Lcd interfacing1
 
Control Word
Control WordControl Word
Control Word
 

Viewers also liked

06 Interfacing Keypad 4x4.2016
06 Interfacing Keypad 4x4.201606 Interfacing Keypad 4x4.2016
06 Interfacing Keypad 4x4.2016Mohamed Fawzy
 
AVR_Course_Day6 external hardware interrupts and analogue to digital converter
AVR_Course_Day6 external hardware  interrupts and analogue to digital converterAVR_Course_Day6 external hardware  interrupts and analogue to digital converter
AVR_Course_Day6 external hardware interrupts and analogue to digital converterMohamed Ali
 
AVR_Course_Day7 timers counters and interrupt programming
AVR_Course_Day7 timers counters and  interrupt programmingAVR_Course_Day7 timers counters and  interrupt programming
AVR_Course_Day7 timers counters and interrupt programmingMohamed Ali
 
Regis Pneumatic - Solenoid Valve Quality Process Presentation
Regis Pneumatic - Solenoid Valve Quality Process PresentationRegis Pneumatic - Solenoid Valve Quality Process Presentation
Regis Pneumatic - Solenoid Valve Quality Process PresentationRegis-pneumatic
 
AVR_Course_Day5 avr interfaces
AVR_Course_Day5 avr interfacesAVR_Course_Day5 avr interfaces
AVR_Course_Day5 avr interfacesMohamed Ali
 
AVR_Course_Day2 what is pcb
AVR_Course_Day2 what is pcbAVR_Course_Day2 what is pcb
AVR_Course_Day2 what is pcbMohamed Ali
 
AVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontrollerAVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontrollerMohamed Ali
 
AVR_Course_Day8 motor drive and pwm techniques
AVR_Course_Day8 motor drive and pwm techniquesAVR_Course_Day8 motor drive and pwm techniques
AVR_Course_Day8 motor drive and pwm techniquesMohamed Ali
 
Introduction to Basic electronics
Introduction to Basic electronicsIntroduction to Basic electronics
Introduction to Basic electronicsMyrna Cabrera
 
AVR_Course_Day1 basic electronics
AVR_Course_Day1 basic electronicsAVR_Course_Day1 basic electronics
AVR_Course_Day1 basic electronicsMohamed Ali
 
AVR programming - BASICS
AVR programming - BASICSAVR programming - BASICS
AVR programming - BASICSRobotix 2011
 

Viewers also liked (18)

water latching solenoid valve
water latching solenoid valvewater latching solenoid valve
water latching solenoid valve
 
06 Interfacing Keypad 4x4.2016
06 Interfacing Keypad 4x4.201606 Interfacing Keypad 4x4.2016
06 Interfacing Keypad 4x4.2016
 
AVR_Course_Day6 external hardware interrupts and analogue to digital converter
AVR_Course_Day6 external hardware  interrupts and analogue to digital converterAVR_Course_Day6 external hardware  interrupts and analogue to digital converter
AVR_Course_Day6 external hardware interrupts and analogue to digital converter
 
Catia introduccionv5
Catia introduccionv5Catia introduccionv5
Catia introduccionv5
 
AVR_Course_Day7 timers counters and interrupt programming
AVR_Course_Day7 timers counters and  interrupt programmingAVR_Course_Day7 timers counters and  interrupt programming
AVR_Course_Day7 timers counters and interrupt programming
 
Regis Pneumatic - Solenoid Valve Quality Process Presentation
Regis Pneumatic - Solenoid Valve Quality Process PresentationRegis Pneumatic - Solenoid Valve Quality Process Presentation
Regis Pneumatic - Solenoid Valve Quality Process Presentation
 
AVR_Course_Day5 avr interfaces
AVR_Course_Day5 avr interfacesAVR_Course_Day5 avr interfaces
AVR_Course_Day5 avr interfaces
 
AVR_Course_Day2 what is pcb
AVR_Course_Day2 what is pcbAVR_Course_Day2 what is pcb
AVR_Course_Day2 what is pcb
 
AVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontrollerAVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontroller
 
AVR_Course_Day8 motor drive and pwm techniques
AVR_Course_Day8 motor drive and pwm techniquesAVR_Course_Day8 motor drive and pwm techniques
AVR_Course_Day8 motor drive and pwm techniques
 
Catia v5 NOTES
Catia v5  NOTESCatia v5  NOTES
Catia v5 NOTES
 
Introduction to Basic electronics
Introduction to Basic electronicsIntroduction to Basic electronics
Introduction to Basic electronics
 
BASIC ELECTRONICS
BASIC ELECTRONICS BASIC ELECTRONICS
BASIC ELECTRONICS
 
AVR_Course_Day1 basic electronics
AVR_Course_Day1 basic electronicsAVR_Course_Day1 basic electronics
AVR_Course_Day1 basic electronics
 
Z:\catia v5
Z:\catia v5Z:\catia v5
Z:\catia v5
 
Electronics ppt
Electronics ppt Electronics ppt
Electronics ppt
 
AVR ATmega32
AVR ATmega32AVR ATmega32
AVR ATmega32
 
AVR programming - BASICS
AVR programming - BASICSAVR programming - BASICS
AVR programming - BASICS
 

Similar to 04 Interfacing LCD Displays.2016

Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming Dr. Pankaj Zope
 
Moving message display
Moving message displayMoving message display
Moving message displayviraj1989
 
Embedded Systems Project 3rd Year
Embedded Systems Project 3rd YearEmbedded Systems Project 3rd Year
Embedded Systems Project 3rd YearAndrew Kozik
 
DEF CON 23 - Rodringo Almeida - embedded system design from electronics
DEF CON 23 - Rodringo Almeida - embedded system design from electronics DEF CON 23 - Rodringo Almeida - embedded system design from electronics
DEF CON 23 - Rodringo Almeida - embedded system design from electronics Felipe Prado
 
SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51 SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51 aroosa khan
 
Lcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilogLcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilogsumedh23
 
laptop repairing course in delhi
laptop repairing course in delhilaptop repairing course in delhi
laptop repairing course in delhiAmit Gupta
 
Ece 120L final project Christopher Hays
Ece 120L final project Christopher HaysEce 120L final project Christopher Hays
Ece 120L final project Christopher HayschristopherhaysCSUF
 
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, NepalArduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepalbishal bhattarai
 
Expanding The Micro Blaze System
Expanding  The Micro Blaze  SystemExpanding  The Micro Blaze  System
Expanding The Micro Blaze Systemiuui
 
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
 
Lcd tutorial for interfacing with microcontrollers basics of alphanumeric lc...
Lcd tutorial for interfacing with microcontrollers  basics of alphanumeric lc...Lcd tutorial for interfacing with microcontrollers  basics of alphanumeric lc...
Lcd tutorial for interfacing with microcontrollers basics of alphanumeric lc...mdkousik
 

Similar to 04 Interfacing LCD Displays.2016 (20)

Alp lcd
Alp lcdAlp lcd
Alp lcd
 
Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming
 
Moving message display
Moving message displayMoving message display
Moving message display
 
Embedded Systems Project 3rd Year
Embedded Systems Project 3rd YearEmbedded Systems Project 3rd Year
Embedded Systems Project 3rd Year
 
Dfr0464 datasheet
Dfr0464 datasheetDfr0464 datasheet
Dfr0464 datasheet
 
DEF CON 23 - Rodringo Almeida - embedded system design from electronics
DEF CON 23 - Rodringo Almeida - embedded system design from electronics DEF CON 23 - Rodringo Almeida - embedded system design from electronics
DEF CON 23 - Rodringo Almeida - embedded system design from electronics
 
SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51 SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51
 
_LCD display-mbed.pdf
_LCD display-mbed.pdf_LCD display-mbed.pdf
_LCD display-mbed.pdf
 
Lcd n PIC16F
Lcd n PIC16FLcd n PIC16F
Lcd n PIC16F
 
Lcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilogLcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilog
 
Est 8 2 nd
Est 8 2 ndEst 8 2 nd
Est 8 2 nd
 
laptop repairing course in delhi
laptop repairing course in delhilaptop repairing course in delhi
laptop repairing course in delhi
 
Ece 120L final project Christopher Hays
Ece 120L final project Christopher HaysEce 120L final project Christopher Hays
Ece 120L final project Christopher Hays
 
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, NepalArduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
 
Expanding The Micro Blaze System
Expanding  The Micro Blaze  SystemExpanding  The Micro Blaze  System
Expanding The Micro Blaze System
 
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
 
LCD_Example.pptx
LCD_Example.pptxLCD_Example.pptx
LCD_Example.pptx
 
Lab Activity 3
Lab Activity 3Lab Activity 3
Lab Activity 3
 
Lcd tutorial for interfacing with microcontrollers basics of alphanumeric lc...
Lcd tutorial for interfacing with microcontrollers  basics of alphanumeric lc...Lcd tutorial for interfacing with microcontrollers  basics of alphanumeric lc...
Lcd tutorial for interfacing with microcontrollers basics of alphanumeric lc...
 
Led flash
Led flashLed flash
Led flash
 

More from Mohamed Fawzy

07 Analogue to Digital Converter(ADC).2016
07 Analogue to Digital Converter(ADC).201607 Analogue to Digital Converter(ADC).2016
07 Analogue to Digital Converter(ADC).2016Mohamed Fawzy
 
05 EEPROM memory.2016
05 EEPROM memory.201605 EEPROM memory.2016
05 EEPROM memory.2016Mohamed Fawzy
 
02 Interfacing High Power Devices.2016
02 Interfacing High Power Devices.201602 Interfacing High Power Devices.2016
02 Interfacing High Power Devices.2016Mohamed Fawzy
 
أزاى تروح فى داهيه !!!
أزاى تروح فى داهيه !!!أزاى تروح فى داهيه !!!
أزاى تروح فى داهيه !!!Mohamed Fawzy
 
C programming day#2.
C programming day#2.C programming day#2.
C programming day#2.Mohamed Fawzy
 
C programming day#3.
C programming day#3.C programming day#3.
C programming day#3.Mohamed Fawzy
 

More from Mohamed Fawzy (9)

07 Analogue to Digital Converter(ADC).2016
07 Analogue to Digital Converter(ADC).201607 Analogue to Digital Converter(ADC).2016
07 Analogue to Digital Converter(ADC).2016
 
05 EEPROM memory.2016
05 EEPROM memory.201605 EEPROM memory.2016
05 EEPROM memory.2016
 
02 Interfacing High Power Devices.2016
02 Interfacing High Power Devices.201602 Interfacing High Power Devices.2016
02 Interfacing High Power Devices.2016
 
أزاى تروح فى داهيه !!!
أزاى تروح فى داهيه !!!أزاى تروح فى داهيه !!!
أزاى تروح فى داهيه !!!
 
Ce from a to z
Ce from a to zCe from a to z
Ce from a to z
 
Taqa
TaqaTaqa
Taqa
 
C programming day#2.
C programming day#2.C programming day#2.
C programming day#2.
 
C programming day#3.
C programming day#3.C programming day#3.
C programming day#3.
 
C programming day#1
C programming day#1C programming day#1
C programming day#1
 

Recently uploaded

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 

Recently uploaded (20)

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 

04 Interfacing LCD Displays.2016

  • 1. 1 04-Interfacing LCD Displays. By : Mohamed Fawzy Programming AVR Microcontrollers © Mohamed F.A.B 2015
  • 2. Lecture Notes: 2 o Set Your Phone To Vibration Mode. o Ask any time. o During labs, Feel Free To Check Any Materials or Internet. o Slides are self content. o Feel Free To Share This Materials With Your Friends. o Work Hard For Achieving Most Of This Course. © Mohamed F.A.B 2015
  • 3. 3 Don't Forget !!!! © Mohamed F.A.B 2015 Any Expert Was Once A Beginner 
  • 4. 4 Lesson(10). © Mohamed F.A.B 2015 Lesson (10): Interfacing LCDs displays with Microcontroller.
  • 5. 5 Lesson (10) Topics. © Mohamed F.A.B 2015 ► Intro to LCDs screens. ► LCD Hardware Connections. ► LCD built in Functions in MIKROC. ► Displaying Numbers On LCD. ► How to Display Custom Symbols or Characters on LCD. ► How to Connect Multiple LCD With MC using Same Pins. ► Let's Have Fun With LCD.
  • 6. 6 Intro To LCDs Screens. © Mohamed F.A.B 2015  LCD stands for Liquid Crystal Display.  It can be used to display anything (virtually anything!).  There are two common types of LCDs:  Character LCD : Used For Displaying Only Characters, Numbers and some Custom Symbols.  Graphical LCD : Used For Displaying almost everything (Text, symbols and images). “Will be discussed on Level 2”
  • 7. 7 LCDs Memory. © Mohamed F.A.B 2015  Memory in LCD divided into Three types:  DDRAM Memory: storing characters to be displayed.  CGROM Memory: contains standard character map with all characters that can be displayed on the screen.  CGRAM Memory: a part from standard characters, the LCD display can also display symbols defined by the user itself. We can use CGRAM to display custom symbols on LCD. NOTE:
  • 8. 8 LCD Hardware Connections. © Mohamed F.A.B 2015 • Pins[RS,R/W,EN] Control Lines. • Pins[D0:D7] Data Lines. Don't swap power pins to avoid damaging your LCD. Take Care:
  • 9. 9 alcd.h functions. © Mohamed F.A.B 2015  Initializing the LCD controller void lcd_init(unsigned char lcd_columns); EX: Lcd_init(16); //for 2*16 LCD  Writing character to LCD void lcd_putchar(char c); EX: Lcd_write (‘A’); //display A on LCD  Defining position of cursor (x,y) void lcd_gotoxy(unsigned char x, unsigned char y); EX: lcd_gotoxy(0,0); //start from column 0 and row 0  write the string str located in SRAM to the LCD void lcd_puts(char *str); EX: lcd_puts(“Hello LCD !!!”);
  • 10. 10 alcd.h functions. Cont’ © Mohamed F.A.B 2015  Clearing the LCD void lcd_clear(void); EX: lcd_clear(); //delete any data on LCD  Write byte to the LCD character generator or LCD CGRAM void write_byte(unsigned char address, unsigned char data); EX: void write_byte(char0, 0);  Writing command to LCD void _lcd_write_data(unsigned char cmd); EX: void _lcd_write_data(0x0E); //display LCD cursor
  • 11. 11 LCD useful commands codes. © Mohamed F.A.B 2015 Code Function 0x0C Cursor OFF 0x0E Cursor underline 0x0F Cursor ON 0x10 Move cursor left by one character. 0x14 Move cursor right by one character. #define _LCD_CURSOR_OFF 0x0C #define _LCD_CURSOR_UNDERLINE 0x0E #define _LCD_CURSOR_ON 0x0F #define _LCD_CURSOR_LEFT 0x10 #define _LCD_CURSOR_RIGHT 0x14 TIP
  • 12. 12 Displaying Numbers On LCD. © Mohamed F.A.B 2015 • LCD displays data into ASCII format. ASCII Symbol Do (00:99) UP Down Counter With Two Buttons. Exercise:
  • 13. 13 Displaying Custom Symbols On LCD. © Mohamed F.A.B 2015  In some cases you may need to display characters and symbols that not defined in CGROM.  You need to define your symbol into CGRAM. 1 2 3  We use “LCD Custom Char Builder” to draw our pattern. http://extremeelectronics.co.in/avrtutorials/download/LCDCustomCharBuilder.zip
  • 14. 14 Displaying Custom Symbols On LCD. Cont’ © Mohamed F.A.B 2015 Exercise: #include <io.h> #include <alcd.h> #include <delay.h> // Declare your global variables here flash unsigned char char0[8]={0x0A, 0x1F, 0x1F, 0x1F, 0x1F, 0x0E, 0x04, 0 void define_char(unsigned char flash *pc, unsigned char char_code){ unsigned char i,a; a=(char_code<<3)|0x040; for (i=0;i<8;i++)lcd_write_byte(a++,*pc++); } void main(void) { lcd_init(16); lcd_gotoxy(0,0); while (1) { define_char(char0,0); lcd_puts("I "); lcd_putchar(0); lcd_puts(" AVR"); }
  • 15. 15 Connecting Multiple LCD with same I/O Pins. © Mohamed F.A.B 2015  What if we need to use multiple LCD in one project ??!!!!.  We can do that using latch IC 74HC573.  Simply, this IC pass data from input pins to output pins in case we enables that action. We need to interface 2 LCDs with MC using PORTC, then displaying “LCD_1”on first LCD and displaying “LCD_2” on second LCD. Exercise: LCD_1 LCD_2
  • 16. 16 Let's have Fun With LCD . © Mohamed F.A.B 2015
  • 18. Thank You All  18 mo7amed.fawzy33@gmail.com 01006032792 fawzy.fab@gmail.com © Mohamed F.A.B 2015