I I Power supply to control contrast RS=0 to select command register..LCD pin descriptions: Pin 1 2 symbol Vss Vcc …. I/O description Ground +5V power supply 3 4 5 VEE RS R/W …. R/W=1 for read 6 7 8 9 E DBO DB1 DB2 I/O I/O I/O I/O Enable The 8-bit data bus The 8-bit data bus The 8-bit data bus 10 11 12 13 DB3 DB4 DB5 DB6 I/O I/O I/O I/O The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus 14 DB7 I/O The 8-bit data bus . RS=1 to select data register R/W=0 for write. …...

3 P 0.7 .6 P 1.6 P 0.1 P 0.5 P 0.LCD CONNECTION 8051 P 0.5 P 1.0 P 0.4 P 0.7 LCD D0 Vcc 10K Vee POT RS R / W D7 E Vss P 1.2 P 0.

LCD Data Sheet The following shows address locations of LCD RS 0 R/W 0 DB7 1 A DB6 A DB5 A DB4 A DB3 A DB2 A DB1 A DB0 Where AAAAAAA = 0000000 to 0100111 for line 1 and AAAAAAA = 1000000 to 1100111 for line 2 LCD Addressing DB7 Line1(min) 1 DB6 0 DB5 0 DB4 0 DB3 0 DB2 0 DB1 0 DB0 0 Line1(max) Line2(min) Line2(max) 1 1 1 0 1 1 1 0 1 0 0 0 0 0 0 1 0 1 1 0 1 1 0 1 .

Clear display RS 0 R/ W 0 DB 7 0 DB 6 0 DB 5 0 DB 4 0 DB 3 0 DB 2 0 DB 1 0 DB 0 1 Description : Clears entire display and sets DD RAM address 0 in address counter .Takes 1.64 ms for execution Return Home RS 0 R/ W 0 DB 7 0 DB 6 0 DB 5 0 DB 4 0 DB 3 0 DB 2 0 DB 1 1 DB 0 - Description: Sets DD RAM address 0 as address counter. .Takes maximum of 1.Also returns display being shifted to original position.64ms as max execution time.DD RAM contents remain unchanged .

cursor On/Off (c) .Maximum execution time is 40 µs Display On/Off Control RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 0 Description : 0 0 0 0 0 1 D C B Sets On/Off of entire display (D) . and blink the cursor position character (B).These operations are performed during data write and read .Takes maximum 40 µs for execution .Entry Mode set : RS 0 R/W 0 DB7 0 DB6 0 DB 5 0 DB4 0 DB3 0 DB2 1 DB1 1/D DB0 S Description : Sets cursor move direction and specifies shift of display.

Takes 40µs maximum for execution . number of display lines(L) and character font (F). Function Set RS 0 R/W 0 DB7 0 DB6 0 DB5 1 DB4 DL DB3 N DB2 F DB1 DB0 - Description Sets interface data length (DL) .Cursor or Display Shift RS 0 R/W 0 DB7 0 DB6 0 DB5 0 DB4 1 DB3 S/C DB2 R/L DB1 DB0 - Description: Moves cursor and shifts display without changing DD RAM contents.Takes 40µs max for execution.

cursor on Display on . cursor off Display on.LCD Command codes Hex 1 2 4 6 5 7 8 A C E F 10 14 18 1C 80 C0 38 Register Clear display screen Return home Decrement cursor (shift cursor to left) Increment cursor (shift cursor to right) Shift display right Shift display left Display off. cursor blinking Shift cursor position to left shift cursor position to right Shift the entire display to left Shift the entire display to the right Force cursor to beginning of 1st line Force cursor to beginning of the 2nd line 2 lines and 5 * 7 matrix . cursor off Display off . cursor blinking Display on.

LCD Command codes . Main Prg Starts from here call LCD_Init mov dptr.5 p1. Variable Declaration CDELAY1 data CDELAY2 data Org 00h Sjmp Main Org 50h Main: 30h 31h . From here the Program Starts . Is in .6 p1. displays the string whose base addr.7 p0 .#myname call Disp_Str DPTR Jmp $ . Device Maping LCD_Data LCD_Rs equ LCD_Rw equ LCD_En equ equ p1.

#38h call LCD_Cmd mov a.#0ch call LCD_Cmd RET LCD_Cmd: call Delay_10ms clr LCD_En mov LCD_Data.#06h call LCD_Cmd mov a.a clr LCD_Rs clr LCD_Rw setb LCD_En nop clr LCD_En RET .LCD Command codes LCD_Init: mov a.#01h call LCD_Cmd mov a.

#250 djnz CDelay2.here djnz CDelay1.#20 mov CDelay2.0 Myname: END .LCD_Dout: LCD Command codes call Delay_10ms clr LCD_En mov LCD_Data.a setb LCD_Rs clr LCD_Rw setb LCD_En nop clr LCD_En RET Disp_Str: Next_Char: clr a movc a.@a+dptr jz End_Str call LCD_Dout inc dptr jmp Next_char End_Str: RET Delay_10ms: Inner: Here: mov CDelay1.inner RET db “MIC Tech Center”.

cursor blinking Shift cursor position to left shift cursor position to right Shift the entire display to left Shift the entire display to the right Force cursor to beginning of 1st line Force cursor to beginning of the 2nd line 2 lines and 5 * 7 matrix . cursor blinking Display on. cursor on Display on . cursor off Display off .LCD Command codes Hex 1 2 4 6 5 7 8 A C E F 10 14 18 1C 80 C0 38 Register Clear display screen Return home Decrement cursor (shift cursor to left) Increment cursor (shift cursor to right) Shift display right Shift display left Display off. cursor off Display on.

Sign up to vote on this title
UsefulNot useful