You are on page 1of 2

LAB # 9 & 10 TO INTERFACE LCD WITH THE MICROCONTROLLER AND TO WRITE A PROGRAM TO INDICATE LCD.

CODING:
LCD_DATA EQU P0 LCD_RS EQU P2.2 LCD_RW EQU P2.3 LCD_EN EQU P3.4 LCD_INT: CLR LCD_EN MOV A,#38H CALL LCD_COMMAND CALL DELAY MOV A,#0FH CALL LCD_COMMAND CALL DELAY MOV A,#01H CALL LCD_COMMAND CALL DELAY MOV A,#06H CALL LCD_COMMAND CALL DELAY MOV A,#80H CALL LCD_COMMAND CALL DELAY MOV A,#'H' CALL LCD_SENDDATA CALL DELAY MOV A,#'I' CALL LCD_SENDDATA CALL DELAY MOV DPTR,#MYNAME CALL LCD_SENDSTRING MOV A,#0C3H CALL LCD_COMMAND

MOV DPTR,# MYUNI CALL LCD_SENDSTRING AGAIN: SJMP AGAIN DELAY: DJNZ R0,DELAY DJNZ R1,DELAY RET LCD_COMMAND: MOV LCD_DATA,A CLR LCD_RS CLR LCD_RW SETB LCD_EN CALL DELAY CLR LCD_EN RET LCD_SENDDATA: MOV LCD_DATA,A SETB LCD_RS CLR LCD_RW SETB LCD_EN CALL DELAY CLR LCD_EN RET LCD_SENDSTRING: CLR A MOVC A,@A+DPTR JZ EXIT CALL LCD_SENDDATA INC DPTR JMP LCD_SENDSTRING EXIT:RET ORG 400H MYNAME: DB "WELCOME",0 ORG 450H MYUNI:DB "BAHRIA",0 END

DESCRIPTION: We have equated the ports with user friendly initials that are going to be interfaced in this lab. We have used the subroutines for this purpose. A delay label is made to provide a sufficient amount of time to wait. Whatever data we will give it will go through all the process and will be visible to the LCD screen.

You might also like