 Hello, welcome to all of you, myself, Mr. Chauhan Aran, Department of Electronics Engineering from World Change Institute of Technology, Solabu. So today we will see how to interface the LCD display to the microcontroller 8051 and also see how to display the data on the LCD. So after these sessions the student will be able to apply the concept of LCD interfacing in development of the controller based system. So outline of these sessions will be like this, first we will go through the LCD signals, then next we will see how to interface the LCD to the microcontroller 8051 and then we will see how to write the program to display on the LCD. So these are the signals defined for the LCD. LCD is available in the form of chips, means along with the display the LCD is having the various pins and these pins are shown below. The LCD is having the eight data pins that is D0 to D7, then next LCD is having the pin called RS stands for register select, read write pin is there to read and write the data to the LCD, then to enable the data pins the enable signal is required, LCD is operating on the DC plus 5 volt supply and the one voltage called the VEE we can vary between 0 to plus 5 volt to control the contrast of the display. So LCD is having D0 to D7 data pins, so whatever the character to be displayed we have to send this character through the pin D0 to D7. Then there is need to select the LCD register, LCD is having the two registers called the command register and another one is the data register. So while sending the command to the LCD there is need to select the command register by making the RS equal to 0, while sending the character to be displayed on the LCD there is need to select the data register of the LCD by making RS signal 1, while writing the data or the command to the LCD read write signal must be kept at logic 0 and while reading the data from the LCD read write signal must be kept at logic 1. So normally the LCD is used to display the information, so what we can read from the LCD here from LCD only we can read whether the LCD is busy or not. So if LCD is busy in displaying the information or it may be busy in executing the command then it asserts the busy signal. So we can read whether the LCD is busy or it is free to execute the command or to display the information. This enable signal is used by the LCD to latch the information on the data bus or pins, there is need to send the high pulse on EN pin to latch the data on data pins into the LCD. Next we will see how to interface the LCD to the 8051. So as we have seen the LCD is having 8 data pins, so use the available port of the 8051 to connect the data pins of the LCD. Here I have used the port 1 for the data pins and the 3 control signals are required that is register select, read write and enable signal. Now these 3 control signals are connected to the port 2.0, port 2.1 and the second pin of the port 2 respectively. Now all these 3 control signals are input to the LCD. So there is need to send these 3 control signals from the 8051 to the LCD as per the requirement. So after making all these the hardware connection means the interfacing the LCD to the 8051. The next we will see how to write the program to display or what steps to be followed while writing the program to display on LCD. So very first while displaying the any information on the LCD there is need to send the sequence of required commands one by one after a delay of few milliseconds. Now why the delay is required between the transmission of the 2 commands or the transmission of the 2 characters to be displayed because after receiving the command or the character to be displayed LCD is requiring some amount of time to display or to execute the received command. So for that there is need to give some time for the LCD that's why between the transmission of 2 commands a delay of few milliseconds is required. Now what amount of time the LCD will take that will be the varying from LCD device to device but normally it is in from few millisecond to microsecond. And why there is need to send the commands to the display. Now here I had listed out few commonly or frequently required commands. Most of the times we need to clear the screen. So there is need to send the command called 01H to clear the screen. Sometime there is need to move the cursor at right position after displaying the character. So for that the command provided is 06H. Similarly 0EH is the command to make the LCD display on and the cursor blinking. Now here we are considering the LCD with 2 lines means the 16 by 2 LCD which is having the 2 lines and on each line it is capable to display the 16 character. Now one can decide the starting position of the display. For that the address of the first line is provided that is the 80 means when you are sending the command 80 to the LCD then whatever the character is sent for the displaying that will be displayed on first line first column. Similarly the address of the second line is C0 means when you are sending the command to the C0 then the character will be displayed on second line first column. And this address starts from first line 80 to 8F and C0 to CF for the second line. Now you think how to start the display from the first line and fifth column. You pause the video and write your answer. Now answer of this question is to start the display from first line and fifth column send the command 85H to the LCD. Now to send the command to the LCD we have to follow the below mentioned steps. So very first you load the required command into the accumulator and send it to the port one. Next is to select the command register make RS equal to 0. Now how will you make the RS equal to 0? So in interfacing we have connected this RS signal or RS pin to the P2.0. So clear the P2.0 so RS will be gates cleared and the LCD will select the command register and whatever the information sent to the LCD that will be get stored in the command register. Now here this command sending is also the write operation. So to select the write operations make read write pin 0. Now to make the read write equal to 0 clear the pin P2.1. So whatever the information available on the data pin that will be read write into the LCD. Now next step is there is need to send the high pulse on P2.2 to enable the LCD data pins. Means after receiving the high pulse on enable pin LCD will latch the information available on data pin inside the LCD. Now how will you send the high pulse? So first make P2.21 wait for some time and then clear the P2.2 pin. Then before sending the next command call a delay of few milliseconds. After sending the sequence of the required commands next send the character to be displayed one by one after a delay of few milliseconds. Now to display the character on the LCD there is need to send the ASCII value of that particular character. So to send the character to be displayed on the LCD first load the ASCII value of character to be displayed into the accumulator and send it to the port 1. Then send P set P2.0 to make rs equal to 1 for selecting the data register. Now to select the read write operation clear the P2.1 for selecting the write operation. Now to latch the character inside the LCD send high pulse on P2.2 to enable the LCD data pins and then before sending the next character wait for some time. That means call a delay of few milliseconds. So in this way we can display the characters on the LCD. References for this is the microcontroller book from Ajay Deshmukh and the 8051 from Majidi and Majidi. Thank you.