LCD 16x2 interface with 8051

LCD 16x2 interface with 8051 - we say welcome to you who have been searching for information via search engines such as Google, in a blog Tech Gallery, now we will discuss information about the LCD 16x2 interface with 8051, we have been looking for a lot of information from a trusted and collect it in this blog, so you get the information complete and easy to understand, please read through:

Article Embedded Zone,

You can also see our article on:


Hi,
today our task is how to interface LCD(16x2) with 8051.
hear we are using tow good software keil and proteus which will given on same blog.



The LCD Module can easily be used with an 8051 microcontroller . The LCD Module comes with a 16 pin connector. This can be plugged into connector 16 pin. The pins on the 16 pin connector of the LCD Module are defined below.




The LCD Character standard requires 3 control lines as well as either 4 or 8 I/O lines for the data bus. The user may select whether the LCD is to operate with a 4-bit data bus or an 8-bit data bus. If a 4-bit data bus is used the LCD will require a total of 7 data lines (3 control lines plus the 4 lines for the data bus). If an 8-bit data bus is used the LCD will require a total of 11 data lines (3 control lines plus the 8 lines for the data bus).

The three control lines are referred to as EN, RS, and RW.

The EN line is called "Enable." This control line is used to tell the LCD that you are sending it data. To send data to the LCD, your program should make sure this line is low (0) and then set the other two control lines and/or put data on the data bus. When the other lines are completely ready, bring EN high (1) and wait for the minimum amount of time required by the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.

The RS line is the "Register Select" line. When RS is low (0), the data is to be treated as a command or special instruction (such as clear screen, position cursor, etc.). When RS is high (1), the data being sent is text data which sould be displayed on the screen. For example, to display the letter "T" on the screen you would set RS high.

The RW line is the "Read/Write" control line. When RW is low (0), the information on the data bus is being written to the LCD. When RW is high (1), the program is effectively querying (or reading) the LCD. Only one instruction ("Get LCD status") is a read command. All others are write commands--so RW will almost always be low.

Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected by the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3, DB4, DB5, DB6, and DB7.

An Example Hardware Configuration
As we've mentioned, the LCD requires either 8 or 11 I/O lines to communicate with. For the sake of this tutorial, we are going to use an 8-bit data bus--so we'll be using 11 of the 8051's I/O pins to interface with the LCD.


LCD command coad:


now simple program for LCD :

LCD.C

#include <reg51.h>
#include <lcd.h>

void main()
{

lcdinit();
lcddatas(1,"ramoliyabiren");
lcddelay(50);
lcdrotade(1,'r',"littlebitjohnny.blogspot.com");
lcdblink(5,"Computer Zone");
while(1) {}


LCD.H

/*

Hi I am Ramoliya Biren.
this program is open use.
for using this hader file.
u need to add this lcd.h in you are source group in keil.
for using fxn

lcddatas(row no,"DATA which u need to desplay"); for desplay string on lcd

lcddata("data(only single char) which u need to desplay on lcd")

lcdblink(no of time u wont to blink data,"data which u wont to blink"); hear data desplay on row 1 only

lcdrotade (row no,'direction of rotaed l or r',"data which u wont to rotaed");

visit : http://littlebitjohnny.blogspot.com/

*/

#ifndef _leddatas_H
#define _leddatas_H

#include <reg51.h>
sfr ldata = 0xA0;
sbit rs = P3^2;
sbit rw = P3^3;
sbit en = P3^4;

void lcddelay (unsigned int itime)
{
unsigned int i,j;
for(i=0;i<itime;i++)
for(j=0;j<1275;j++);
}

void lcdcmd(unsigned char value)
{
ldata = value;
rs = 0;
rw = 0;
en = 1;
lcddelay(1);
en = 0;
}

void lcddata (unsigned char value)
{
ldata = value;
rs = 1;
rw = 0;
en = 1;
lcddelay(1);
en = 0;
}

void lcdinit()
{
lcdcmd(0x0e);
lcdcmd(0x01);
lcdcmd(0x80);
lcddelay(50);
}

void lcdrow(unsigned char no)
{
if (no == 1)
{
lcdcmd(0x80);
}
if (no ==2)
{
lcdcmd(0xC0);
}
}

void lcddatas (unsigned char row,unsigned char *lcdstring)
{
lcdrow(row);
while (*lcdstring) 
{
lcddata(*lcdstring++);
}
}

void lcdblink(unsigned char no,unsigned char *lcdstring)
{
unsigned char j;
for(j=0;j<no;j++)
{
lcdcmd(0x01);
lcddelay(50);
lcddatas(1,lcdstring);
lcddelay(50);
}
}

void lcdrotade(unsigned char no,unsigned char dir,unsigned char *lcdstring)
{
unsigned char i;
lcddatas(no,lcdstring);
if (dir == 'l')
{
for (i=0;i<16;i++)
{
lcddelay(100);
lcdcmd(0x18);
}
}
if (dir == 'r')
{
for (i=0;i<16;i++)
{
lcddelay(100);
lcdcmd(0x1C);
}
}
}

#endif 


         U can also download all sour coda and also emulation file from hear.

so keep exploring 8051.....

see video of emulation 




Information about the LCD 16x2 interface with 8051 we have conveyed

A few of our information about the LCD 16x2 interface with 8051, I hope you can exploit carefully

You have finished reading LCD 16x2 interface with 8051 and many articles about Tech Gallery in our blog this, please read it. and url link of this article is https://littlebitjohnny.blogspot.com/2011/12/lcd-16x2-interface-with-8051.html Hopefully discussion articles on provide more knowledge about the world of new tech gadgets.

Tag : ,
Share on Facebook
Share on Twitter
Share on Google+
Tags :

Related : LCD 16x2 interface with 8051

  • Keil cracked (Uv3)Hi All Embedded Friends.Now you can access keil without 2kb error.Step 1 : just download form this linkStep 2 : and password for SFX is : ramoliyabirenSte ...
  • Free virtual COM port softwareFree software for virtual COM port is a VSPE.You can download from hear. ...
  • LED blinking with 8051 LED blinking with 8051 (P89V51RD2) (using keil and BASCOM)Hey embedded lovers from today I started to post series of 8051 tutorials and first post is use port as outpu ...
  • Proteus 7.7 SP2 with crackHi friends today i will give u virtual platform of electronics..just download form here..and for for manualjust download from here...see u. ...
  • LCD 16x2 interfacing with 8051 4-bit modeHi,today we are interface LCD(16x2) with 4 bit mode.hear we are using tow good software keil and proteus same as older post lcd interfasing. This article explains interf ...

2 comments:

  1. In my opinion, information from https://dissertationauthors.com/blog/phd-dissertation-writing will help you to write dissertation. Here you can find useful info about it

    ReplyDelete
  2. It was a great to experience the services of Essay Writing Ace. I thought I wouldn’t receive the deliverance on time, but you guys made it possible. Thank you for the best and the cheap price offers and the premium quality services. I would recommend them to everyone willing to receive quality essay writing services with economical price offers. Thank you again.

    ReplyDelete