Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Interface lcd with pic16f877a microcontroller

Status
Not open for further replies.

svinoth86

Newbie level 6
Joined
Nov 13, 2010
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,420
how to Interface lcd with pic16f877a microcontroller?

---------- Post added at 13:47 ---------- Previous post was at 13:46 ----------

#include<htc.h>
#define rs RC0
#define rw RC1
#define en RC2
delay(unsigned char d)
{
while(d--);
}
lcd_data(unsigned char c)
{
PORTD=c;
rs=1;
rw=0;
en=1;
delay(50);
en=0;
}

lcd_cmd(unsigned char c)
{
PORTD=c;
rs=0;
rw=0;
en=1;
delay(50);
en=0;
}
lcd_str(unsigned char *s)
{
while(*s)
{
lcd_data(*s);
s++;
}
}

lcd_init()
{
lcd_cmd(0x38);
lcd_cmd(0x0c);
lcd_cmd(0x80);

}
void main()
{
TRISC=0x00;
PORTC=0x00;
TRISD=0x00;
PORTD=0x00;
lcd_init();
//lcd_data('a');
lcd_str(" PIC ");
lcd_cmd(0xc0);
lcd_str(" 16F877A ");
while(1);

}
 

**broken link removed**
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top