LCD 16x2 interfacing with 8051 4-bit mode

LCD 16x2 interfacing with 8051 4-bit mode - is the information you are looking for, and in the blog Google News we have provided her, all right in this article titled LCD 16x2 interfacing with 8051 4-bit mode we will discuss it in full, in addition to the information we have also provided a lot of info about the latest gadgets and a wide range of tips and tricks that according to the gadget you are using, well please continue reading:

Penyanyi : LCD 16x2 interfacing with 8051 4-bit mode
Judul lagu : LCD 16x2 interfacing with 8051 4-bit mode
Article Embedded Zone,

You can also see our article on:


LCD 16x2 interfacing with 8051 4-bit mode



Hi,
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 interfacing of LCD with 8051 using 4-bit mode. In this mode only four pins are used for sending data and command instructions. This mode has the advantage over the 8-bit mode as it uses less number of pins. The remaining pins of the controller are available for normal use.

The Data or command is sent in nibble form (1 nibble= 4 bit) in the 4-bit mode. The higher nibble is sent first followed by the lower nibble. The function of RS, RW and EN pins remains similar to 8-bit mode.

Circuit description: 
Connections of LCD with 8051 are shown in circuit diagram. In 4-bit mode, the Data lines must be connected with D4, D5, D6 and D7 pins of LCD module.

Initialization: 
The LCD can be configured in 4-bit mode by sending appropriate instruction which is called “Function set” to it. The Function set is hexadecimal instruction for LCD MPU unit, which selects working modes of LCD. The “Function Set” is mentioned in following table:

Instruction
Rs
Rw
D7
D6
D5
D4
D3
D2
D1
D0
Function set
0
0
0
0
1
DL
N
F
-
-
  
Description: 
DL - Data Length (DL = 1 8bit, DL = 0 4bit)
N - No. of Lines (N = 1 2Lines, N = 0 1Lines)
F - Fonts (F = 1 5x10 dots, F = 0 5x7 dots)

According to table, the value of Function Set for 4 –bit mode will be 0010 0000(0x20) because DL=0. The value “Function Set” for the LCD configuration 2 line (N=1), 5X7 dots (F=0) and 4-bit (DL=0) mode will be 0010 1000(0x28).

When the power supply is given to LCD, it remains in 8-bit mode. Now, if 0x20 is sent, lower nibble will not be received by LCD because four data lines (D4-D7) are connected, so 0x02 is sent instead of 0x20.

now simple program for LCD :

LCD.C

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

void main()
{

lcdinit();
lcddatas(1,"ramoliyabiren");
lcddelay(50);
lcdrotade(1,'r',"googledoodlenewstoday.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://googledoodlenewstoday.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 here.

so keep exploring 8051.....

see video of emulation 




Demikianlah Artikel LCD 16x2 interfacing with 8051 4-bit mode

Sekian Kunci gitar LCD 16x2 interfacing with 8051 4-bit mode, mudah-mudahan bisa memberi manfaat untuk anda semua. baiklah, sekian postingan Chord gitar lagu kali ini.

Anda sedang membaca artikel LCD 16x2 interfacing with 8051 4-bit mode dan artikel ini url permalinknya adalah https://googledoodlenewstoday.blogspot.com/2012/05/lcd-16x2-interfacing-with-8051-4-bit.html Semoga artikel ini bisa bermanfaat.

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

Related : LCD 16x2 interfacing with 8051 4-bit mode

  • Custom characters on 16x2 LCDHi,today we are display Custom characters on 16x2 LCD.hear we are using tow good software keil and proteus same as older post lcd inte ...
  • LCD 16x2 interface with 8051Hi,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 easi ...
  • BASCOM for 8051 Basic Compiler crackedhi embedded lovers now 8051 is easy than u think. with BASCOM.no need any header file no need any complex code flow. just go with ...
  • Keil uVision4 PortableHi keil lovers i think you might be enjoying keil4 with crack.this you can use keil4 any where from your pan drive, with this downloading Portab ...
  • BASCOM-AVR CRACKED        Bascom-AVR - a software environment for creating executable code for AVR microcontrollers close high-level language to the basic rule.  ...

0 komentar:

Posting Komentar