13 LCD

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Character LCD

Instructor: Abdul Basir FAiq, M.Eng


What is LCD
It is display page
There is two type of LCD pages:
1- Graphic
2- Character
Row: 2, shows number of lines
Column: 16, Shows number of character in each line
Types
• Two types of LCD
• Character
• Different sizes based on character capacity, most common 16 columnx2rows, rows can be 1,2,4 and columns,
16,20,40
• It got 16 pins
• 1. V zero (ground)
• 2. V positive 5v
• 3. Ve for contrast and brightness; different voltages can be used for different brightness, therefore
its connected through a voltmeter,
• 4. (register select, RS) determines weather the input is a data or instruction; if RS is zero (grounded)
the input would be instruction, if RS is 1 (power supply) then it treats as data.
• 5. is R/W for reading and writing; if zero it is write, if 1 then it is read and
• 6. is enable
• 7. to 14. is for data communication; the data can be the LCD instruction or it can be used for
character representation.
• 15. 5V and 16. ground is the voltage level for background brightness.
• graphic
Programming of LCD

• Define your mc

• Define your output port, because we are communicating with an external


device (LCD)
Programming of LCD

• Define your LCD


• Config LCD= (size of lcd)
NOTE: both x and * signs can be used
Programming of LCD

• Define your data bus:


• Config LCDBUS= (number of communication line (data bus or db) for the 7th to 14th pins of
LCD)

we have two options, 4 bus bars or 8 bus bars, it means we use 4/8 bus bars for transformation of
our data.
if we use 4, by default the last four pins will be used for communication, in this case since we
don’t use the remaining 4 pins, then we connect the to ground
if we use 8, then we connect all pins of LCD
Programming of LCD

• Define the connection between output pins of the mc and LCD


• Config LCDpin=pin.rs/pin.e/pin.db that you show which port of µC would
be connected
Codes with LCD

• LCD “ ” >>>> this will print the text wrote inside the “”

• CLS >>>> this will remove/delete what we displayed in the LCD


Codes with LCD

• CURSOR

• Display >>>> this is for showing the result or don’t show it


Codes with LCD

• CURSOR

• Display >>>> this is for showing the result or don’t show it


Codes with LCD

• LOWERLINE AND UPPERLINE >>> This is to show our result in lower line or
upper line of the LCD
Codes with LCD

• SHIFT CURSOR RIGH/LEFT >>>> this is like space in the word file

• SHIFTLCD right/left >>>> this will shift the hole text to the right of left
Codes with LCD

• LOCATE X,Y >>> This is to display a text in a specific location


Codes with LCD

• HOME LOWER/UPPER >>> THIS WILL DISPLAY THE TEXT AT THE BEGI NNING OF
LOWER OR UPPER LINE
Graphic LCD
Lecture by: Mojtaba Hoshmand, MSECE, MSMG, PMP
Graphic LCD

• There are different LCDs with different manufacturers.


• Samsung, Toshiba and etc
• They are similar with different configuration so read the datasheet
• They have different sized like 64x128, 128x240, 240x240 and so on
• For example in proteus: LM4228:
• The ports are as below
Ports of LCD LM 4228 (chip ID: T6963)
1. Vss is the ground 15. CE: chip enable: enables chip of the
LCD
2. Vdd is positive voltage
16. RST: Reset
3. Vo/con: contrast setting (connected
through voltmeter) 17. VEE: connects to one side of
voltmeter and other side to supply
4. C/D: equivalent to Rs that determines 18. md: mode is used to determine size
the input is instruction or data; 1 of font. It can be either 6 (8x6) or 8 (8x8)
instruction, 0 data
19. FS1: to set the font of the LCD
5. RD: read
20. HALT: to put a pause for operation
6. WR: write
7-14. are input pins (we always have 8
wire input there is no 4)
Inserting photo
• First you should have a photo smaller or equal to size of your display in
bitmap format. You can use paint for that
• Then you load the saved photo through tools>graphic converter
• Then you save it in bgf format
• The photo should be in codes folder
• The instruction is
• Showpic x0,y0,label: location and then name of the file with the label

You might also like