0% found this document useful (0 votes)
34 views2 pages

LAB # 9 & 10 To Interface LCD With The Microcontroller and To Write A Program To Indicate Lcd. Coding

This document describes a program to interface an LCD display with a microcontroller and write text to the display. It defines port mappings for the LCD data, register select, read/write, and enable pins. It then calls subroutines to initialize the LCD and send commands and character data to display "WELCOME" and "BAHRIA" on separate lines.

Uploaded by

Faryal Mughal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views2 pages

LAB # 9 & 10 To Interface LCD With The Microcontroller and To Write A Program To Indicate Lcd. Coding

This document describes a program to interface an LCD display with a microcontroller and write text to the display. It defines port mappings for the LCD data, register select, read/write, and enable pins. It then calls subroutines to initialize the LCD and send commands and character data to display "WELCOME" and "BAHRIA" on separate lines.

Uploaded by

Faryal Mughal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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