-->

8-Bit Mode LCD interfacing with 8051

By
8-Bit Mode LCD interfacing with 8051

As discussed in the previous section look here ]  ,here providing the circuits diagram and the code including Proteus simulation file .
Controller - Atmel 89s52
Copmiler   - Keil U-Version4
Simulator - Proteus 7.6 
Author  - Gireesh Kumar K.S
Email   - thannara123@gamil,com
Mob     - 9447825107


C- Code for 89S52

#include <REGX51.H>
sfr lcd_dat = 0xA0;
sbit rs = P3 ^ 0; //register select pin
sbit en = P3 ^ 1; //enable pin
 
 
void delay(unsigned int msec)
{
int i, j;
for (i = 0; i < msec; i++)
for (j = 0; j < 1275; j++);
}
 
void lcd_strobe()
{
en = 1;
delay(1);
en = 0;
}
 
void lcdcmd(unsigned char gk)
{
lcd_dat = gk;
rs = 0;
lcd_strobe();
}
 
void lcd_Ini()
{
lcdcmd(0x38);
delay(30);
lcdcmd(0x0c);
delay(10);
lcdcmd(0x06);
delay(10);
lcdcmd(0x01);
delay(10);
 
}
 
void lcd_data(unsigned char gk)
{
lcd_dat = gk;
rs = 1;
lcd_strobe();
}
 
void string(const char *q)
{
while (*q) {
lcd_data(*q++);
}
}
 
void main()
{
P2 = 0x00;
P3 = 0x00;
 
 
lcd_ini();
string("Hello world ");
lcdcmd(0xc0);
string("Testing "); // test display
lcdcmd(0xc9);
 
lcd_data(58); // direct entry display
 
while (1) {
} // for endeless  
 
}



Download here the full project including Proteus file
Download



More Posts

gElectron. Powered by Blogger.

Contributors

16x2 LCD Interfacing with STM32,STM32F103C6

 16x2 LCD  Interfacing with STM32,STM32F103C6 lcd_init(); LCD_LINE1; lcd_String(" GeElectron"); LCD_LINE2; lc...

Contact Form

Name

Email *

Message *

Contact us

Name

Email *

Message *

Follow Us

https://www.facebook.com/gElectron-393939667321867/ FBbox/https://www.facebook.com/IVYthemes

Comments

[blogger]

MKRdezign

Test
google.com, pub-8429441124104529, DIRECT, f08c47fec0942fa0
[blogger]

Latest

[recent][newsticker]

Technology

Top Ads

RECENT COMMENTS

Subscribe Via Email

Subscribe to our newsletter to get the latest updates to your inbox. ;-)


Your email address is safe with us!

RECENT COMMENTS